Commit a67b8082 authored by Nicolas Dumazet's avatar Nicolas Dumazet

use a set instead of a list


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36567 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a831ee72
...@@ -377,18 +377,17 @@ class BusinessPath(Path, Predicate): ...@@ -377,18 +377,17 @@ class BusinessPath(Path, Predicate):
full simulation trees per applied rule full simulation trees per applied rule
""" """
portal_catalog = self.getPortalObject().portal_catalog portal_catalog = self.getPortalObject().portal_catalog
root_applied_rule_list = [] root_applied_rule_set = set()
delivery_simulation_movement_list = portal_catalog( delivery_simulation_movement_list = portal_catalog(
delivery_uid=[x.getUid() for x in explanation.getMovementList()]) delivery_uid=[x.getUid() for x in explanation.getMovementList()])
for simulation_movement in delivery_simulation_movement_list: for simulation_movement in delivery_simulation_movement_list:
applied_rule = simulation_movement.getRootAppliedRule().getPath() applied_rule = simulation_movement.getRootAppliedRule().getPath()
if applied_rule not in root_applied_rule_list: root_applied_rule_set.add(applied_rule)
root_applied_rule_list.append(applied_rule)
simulation_movement_list = portal_catalog( simulation_movement_list = portal_catalog(
portal_type='Simulation Movement', causality_uid=self.getUid(), portal_type='Simulation Movement', causality_uid=self.getUid(),
path=['%s/%%' % x for x in root_applied_rule_list]) path=['%s/%%' % x for x in root_applied_rule_set])
return [simulation_movement.getObject() for simulation_movement return [simulation_movement.getObject() for simulation_movement
in simulation_movement_list in simulation_movement_list
......
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