Commit 17cec174 authored by Nicolas Dumazet's avatar Nicolas Dumazet

only copy the set if we're modifying it


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37099 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3690d403
......@@ -690,11 +690,14 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
for id, t in tree_node.visited_movement_dict.iteritems():
subdocument, path = t
to_check = path_set_to_check.copy()
to_check.discard(path)
if not to_check:
# no more paths to check in this branch
continue
to_check = path_set_to_check
# do we need to change/copy the set?
if path in to_check:
if len(to_check) == 1:
# no more paths to check in this branch
continue
to_check = to_check.copy()
to_check.remove(path)
subtree = tree_node.get(id, treeNode())
for d in descendantGenerator(subdocument, subtree, to_check):
yield d
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment