Skip to content

Commit d998975

Browse files
authored
Refactor: use generator expression in all() for short-circuit evaluation (#470)
1 parent 94afed8 commit d998975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py_trees/composites.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def tick(self) -> typing.Iterator[behaviour.Behaviour]:
727727
new_status = common.Status.FAILURE
728728
except StopIteration:
729729
if type(self.policy) is common.ParallelPolicy.SuccessOnAll:
730-
if all([c.status == common.Status.SUCCESS for c in self.children]):
730+
if all(c.status == common.Status.SUCCESS for c in self.children):
731731
new_status = common.Status.SUCCESS
732732
self.current_child = self.children[-1]
733733
elif type(self.policy) is common.ParallelPolicy.SuccessOnOne:

0 commit comments

Comments
 (0)