Commit e68d9bde authored by Nicolas Dumazet's avatar Nicolas Dumazet

reverting r31508. Add a comment explaining why sets cant be used for a

cleaner algorithm


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31509 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9a0f030
...@@ -148,11 +148,14 @@ class TradeCondition(Path, Transformation, XMLMatrix): ...@@ -148,11 +148,14 @@ class TradeCondition(Path, Transformation, XMLMatrix):
# it is possible, that specialised object cannot be specialised # it is possible, that specialised object cannot be specialised
# anymore # anymore
continue continue
difference = set(child_specialised_value_list).difference(\ # Use a set for faster lookups. We do not use sets everywhere
# because search order does matter
intersection = set(child_specialised_value_list).intersection(\
set(visited_trade_condition_list)) set(visited_trade_condition_list))
for model in child_specialised_value_list:
# don't add model that have already been visited. This permit to # don't add model that have already been visited. This permit to
# visit all the tree and to prevent having circular dependency # visit all the tree and to prevent having circular dependency
for model in difference: if model not in intersection:
specialise_value_list.append(model) specialise_value_list.append(model)
# only add those who matches the portal type given # only add those who matches the portal type given
if model in child_visited_trade_condition_list: if model in child_visited_trade_condition_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