Commit b4b98a9c authored by Vincent Pelletier's avatar Vincent Pelletier

Avoid unneeded function calls in inner loop.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15406 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 45d6781e
...@@ -416,6 +416,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -416,6 +416,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
user = _getAuthenticatedUser(self) user = _getAuthenticatedUser(self)
allowedRolesAndUsers = self._listAllowedRolesAndUsers(user) allowedRolesAndUsers = self._listAllowedRolesAndUsers(user)
role_column_dict = {} role_column_dict = {}
column_map = self.getSQLCatalog().getColumnMap()
# Patch for ERP5 by JP Smets in order # Patch for ERP5 by JP Smets in order
# to implement worklists and search of local roles # to implement worklists and search of local roles
...@@ -433,7 +434,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -433,7 +434,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
for role in local_roles: for role in local_roles:
# Performance optimisation # Performance optimisation
lower_role = role.lower() lower_role = role.lower()
if self.getSQLCatalog().getColumnMap().has_key(lower_role): if lower_role in column_map:
# If a given role exists as a column in the catalog, # If a given role exists as a column in the catalog,
# then it is considered as single valued and indexed # then it is considered as single valued and indexed
# through the catalog. # through the catalog.
......
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