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,15 +148,18 @@ class TradeCondition(Path, Transformation, XMLMatrix):
# it is possible, that specialised object cannot be specialised
# anymore
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))
# don't add model that have already been visited. This permit to
# visit all the tree and to prevent having circular dependency
for model in difference:
specialise_value_list.append(model)
# only add those who matches the portal type given
if model in child_visited_trade_condition_list:
visited_trade_condition_list.append(model)
for model in child_specialised_value_list:
# don't add model that have already been visited. This permit to
# visit all the tree and to prevent having circular dependency
if model not in intersection:
specialise_value_list.append(model)
# only add those who matches the portal type given
if model in child_visited_trade_condition_list:
visited_trade_condition_list.append(model)
return 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