From b4b98a9c7279d8446f5dd37ca165685184e22cb1 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Wed, 1 Aug 2007 07:25:25 +0000
Subject: [PATCH] Avoid unneeded function calls in inner loop.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15406 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Catalog/CatalogTool.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Catalog/CatalogTool.py b/product/ERP5Catalog/CatalogTool.py
index c0d19a58b8..3a804afba4 100644
--- a/product/ERP5Catalog/CatalogTool.py
+++ b/product/ERP5Catalog/CatalogTool.py
@@ -416,6 +416,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
       user = _getAuthenticatedUser(self)
       allowedRolesAndUsers = self._listAllowedRolesAndUsers(user)
       role_column_dict = {}
+      column_map = self.getSQLCatalog().getColumnMap()
 
       # Patch for ERP5 by JP Smets in order
       # to implement worklists and search of local roles
@@ -433,7 +434,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
             for role in local_roles:
               # Performance optimisation
               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,
                 # then it is considered as single valued and indexed
                 # through the catalog.
-- 
2.30.9