[v2,7/7] dpdk-pmdinfo: do not use len(x) to test for empty
Checks
Commit Message
This fixes the following python lint warnings.
usertools/dpdk-pmdinfo.py:188:11: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
usertools/dpdk-pmdinfo.py:196:21: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
usertools/dpdk-pmdinfo.py:302:11: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
usertools/dpdk-pmdinfo.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -185,7 +185,7 @@ def findDate(self, content):
return None
def parse(self):
- if len(self.contents) < 1:
+ if not self.contents:
print("data/%s-pci.ids not found" % self.date)
else:
vendorID = ""
@@ -193,7 +193,7 @@ def parse(self):
for l in self.contents:
if l[0] == "#":
continue
- elif len(l.strip()) == 0:
+ elif not l.strip():
continue
else:
if l.find("\t\t") == 0:
@@ -307,7 +307,7 @@ def parse_pmd_info_string(self, mystring):
except KeyError:
continue
- if len(pmdinfo["pci_ids"]) != 0:
+ if pmdinfo["pci_ids"]:
print("PMD HW SUPPORT:")
if pcidb is not None:
self.pretty_print_pmdinfo(pmdinfo)