[Erp5-report] r36567 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/BusinessPath.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jun 24 08:20:37 CEST 2010
Author: nicolas.dumazet
Date: Thu Jun 24 08:20:36 2010
New Revision: 36567
URL: http://svn.erp5.org?rev=36567&view=rev
Log:
use a set instead of a list
Modified:
erp5/trunk/products/ERP5/Document/BusinessPath.py
Modified: erp5/trunk/products/ERP5/Document/BusinessPath.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessPath.py?rev=36567&r1=36566&r2=36567&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessPath.py [utf8] Thu Jun 24 08:20:36 2010
@@ -377,18 +377,17 @@ class BusinessPath(Path, Predicate):
full simulation trees per applied rule
"""
portal_catalog = self.getPortalObject().portal_catalog
- root_applied_rule_list = []
+ root_applied_rule_set = set()
delivery_simulation_movement_list = portal_catalog(
delivery_uid=[x.getUid() for x in explanation.getMovementList()])
for simulation_movement in delivery_simulation_movement_list:
applied_rule = simulation_movement.getRootAppliedRule().getPath()
- if applied_rule not in root_applied_rule_list:
- root_applied_rule_list.append(applied_rule)
+ root_applied_rule_set.add(applied_rule)
simulation_movement_list = portal_catalog(
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
in simulation_movement_list
More information about the Erp5-report
mailing list