Skip to content

Commit

Permalink
Do not call len() when length is explicitly zero
Browse files Browse the repository at this point in the history
  • Loading branch information
puigru committed May 3, 2020
1 parent 820743c commit 97ba7aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def task(self, title, unit=None, length=None):
self._step_queue.put(PoisonPill())

def task_it(self, title, iterator, unit=None, length=None):
if not length:
if length is None:
length = len(iterator) if iterator else None
self.task(title, unit=unit, length=length)
for item in iterator:
Expand Down

0 comments on commit 97ba7aa

Please sign in to comment.