From 5695f7668f2692c190bef3fb9d1cbb8719d6d225 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Sun, 22 Sep 2024 22:01:44 +0200 Subject: [PATCH] Use [] instead of list() The code should be a little faster now. --- src/smartcard/scard/scard.i | 2 +- src/smartcard/util/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smartcard/scard/scard.i b/src/smartcard/scard/scard.i index 23aab89f..a27f185a 100644 --- a/src/smartcard/scard/scard.i +++ b/src/smartcard/scard/scard.i @@ -1673,7 +1673,7 @@ Value of state: >>> raise PCSCExceptions.ListReadersException(hresult) >>> >>> # get status change ->>> readerstates = list() +>>> readerstates = [] >>> for reader in readers: >>> readerstates.append((reader, SCARD_STATE_UNAWARE)) >>> diff --git a/src/smartcard/util/__init__.py b/src/smartcard/util/__init__.py index d2d7cf22..3777e53a 100644 --- a/src/smartcard/util/__init__.py +++ b/src/smartcard/util/__init__.py @@ -84,7 +84,7 @@ def toASCIIString(bytelist): ". .~." """ - res = list() + res = [] for b in bytelist: if b < 32 or b > 127: c = '.'