Skip to content

Commit 97ba7aa

Browse files
committed
Do not call len() when length is explicitly zero
1 parent 820743c commit 97ba7aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def task(self, title, unit=None, length=None):
142142
self._step_queue.put(PoisonPill())
143143

144144
def task_it(self, title, iterator, unit=None, length=None):
145-
if not length:
145+
if length is None:
146146
length = len(iterator) if iterator else None
147147
self.task(title, unit=unit, length=length)
148148
for item in iterator:

0 commit comments

Comments
 (0)