Commit 3ecaeb41 authored by Vincent Pelletier's avatar Vincent Pelletier

Micro optimisation as I read code.

Factorise access to extend and get[Acquired]CategoryMembershipList accessor.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44633 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4f6e784a
......@@ -177,15 +177,14 @@ class DomainTool(BaseTool):
else:
category_list = context.getCategoryList()
else:
category_list = []
if acquired:
for tested_base_category in tested_base_category_list:
category_list.extend(
context.getAcquiredCategoryMembershipList(tested_base_category, base=1))
getter = context.getAcquiredCategoryMembershipList
else:
for tested_base_category in tested_base_category_list:
category_list.extend(
context.getCategoryMembershipList(tested_base_category, base=1))
getter = context.getCategoryMembershipList
category_list = []
extend = category_list.extend
for tested_base_category in tested_base_category_list:
extend(getter(tested_base_category, base=1))
if tested_base_category_list != []:
preferred_predicate_category_list = portal_preferences.getPreferredPredicateCategoryList()
......
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