Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
Only calling len(in_row_list) once is better than calling it twice.

Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
  • Loading branch information
dav3r and mcdonnnj committed Dec 30, 2021
1 parent 434d895 commit 84225f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mdyml/convert_cisagov.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def convert() -> None:
logging.debug(
"Processing row %d with %d columns: %s", row_count, len(in_row_list), row
)
if len(in_row_list) != EXPECTED_COLUMN_COUNT:
if (row_column_count := len(in_row_list)) != EXPECTED_COLUMN_COUNT:
logging.warning(
"Skipping row %d with unexpected number of columns %d: %s",
row_count,
len(in_row_list),
row_column_count,
in_row_list,
)
continue
Expand Down

0 comments on commit 84225f5

Please sign in to comment.