Commit a21cb623 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Use a set instead of a list for child_visited_trade_condition

child_visited_trade_condition_list is only used for lookups, it's faster to
rely on a set


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31510 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e68d9bde
......@@ -142,8 +142,8 @@ class TradeCondition(Path, Transformation, XMLMatrix):
# all children
child_specialised_value_list = specialise.getSpecialiseValueList()
# only children that match the portal_type given
child_visited_trade_condition_list = specialise.getSpecialiseValueList(\
portal_type=portal_type_list)
child_visited_trade_condition_set = set(specialise.\
getSpecialiseValueList(portal_type=portal_type_list))
except AttributeError:
# it is possible, that specialised object cannot be specialised
# anymore
......@@ -158,7 +158,7 @@ class TradeCondition(Path, Transformation, XMLMatrix):
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:
if model in child_visited_trade_condition_set:
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