[Zope-Checkins] SVN: Zope/trunk/src/Products/ZCatalog/Catalog.py Avoid the CatalogSearchArgumentsMap creation if we only get a dict as the first argument

Hanno Schlichting hannosch at hannosch.eu
Sun Jul 25 06:38:25 EDT 2010


Log message for revision 115071:
  Avoid the CatalogSearchArgumentsMap creation if we only get a dict as the first argument
  

Changed:
  U   Zope/trunk/src/Products/ZCatalog/Catalog.py

-=-
Modified: Zope/trunk/src/Products/ZCatalog/Catalog.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/Catalog.py	2010-07-25 10:33:12 UTC (rev 115070)
+++ Zope/trunk/src/Products/ZCatalog/Catalog.py	2010-07-25 10:38:24 UTC (rev 115071)
@@ -777,7 +777,11 @@
                           'the acquired request.',
                           DeprecationWarning, stacklevel=2)
             REQUEST = getattr(self, 'REQUEST', None)
-        args = CatalogSearchArgumentsMap(REQUEST, kw)
+        if isinstance(REQUEST, dict) and not kw:
+            # short cut for the best practice
+            args = REQUEST
+        else:
+            args = CatalogSearchArgumentsMap(REQUEST, kw)
         sort_index = self._getSortIndex(args)
         sort_limit = self._get_sort_attr('limit', args)
         reverse = 0



More information about the Zope-Checkins mailing list