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): ...@@ -177,15 +177,14 @@ class DomainTool(BaseTool):
else: else:
category_list = context.getCategoryList() category_list = context.getCategoryList()
else: else:
category_list = []
if acquired: if acquired:
for tested_base_category in tested_base_category_list: getter = context.getAcquiredCategoryMembershipList
category_list.extend(
context.getAcquiredCategoryMembershipList(tested_base_category, base=1))
else: else:
for tested_base_category in tested_base_category_list: getter = context.getCategoryMembershipList
category_list.extend( category_list = []
context.getCategoryMembershipList(tested_base_category, base=1)) 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 != []: if tested_base_category_list != []:
preferred_predicate_category_list = portal_preferences.getPreferredPredicateCategoryList() 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