Skip to content

Commit

Permalink
PERF: Prefer retrieving the next iterator element over slicing
Browse files Browse the repository at this point in the history
Prefer retrieving the next iterator element over slicing.
  • Loading branch information
jhlegarreta committed Jan 24, 2025
1 parent 509e5c6 commit 096f980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tract_querier/tract_math/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def process_output(output, file_output=None):
header = dict(zip(writer.fieldnames, writer.fieldnames))
writer.writerow(header)

first_value = list(output.values())[0]
first_value = next(iter(output.values()))
if (
not isinstance(first_value, str) and
isinstance(first_value, Iterable)
Expand Down

0 comments on commit 096f980

Please sign in to comment.