[CMF-checkins] CVS: Products/CMFCore - CMFCatalogAware.py:1.27

Julien Anguenot ja at nuxeo.com
Fri Apr 22 12:18:37 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv2179

Modified Files:
	CMFCatalogAware.py 
Log Message:
Optimization in case of an indexable container


=== Products/CMFCore/CMFCatalogAware.py 1.26 => 1.27 ===
--- Products/CMFCore/CMFCatalogAware.py:1.26	Fri Apr 22 12:15:40 2005
+++ Products/CMFCore/CMFCatalogAware.py	Fri Apr 22 12:18:37 2005
@@ -85,7 +85,12 @@
         if catalog is not None:
             path = '/'.join(self.getPhysicalPath())
             for brain in catalog.unrestrictedSearchResults(path=path):
-                ob = self.unrestrictedTraverse(brain.getPath(), None)
+                brain_path = brain.getPath()
+                # self is treated at the end of the method
+                # Optimization in case of an indexable container
+                if brain_path == path:
+                    continue
+                ob = self.unrestrictedTraverse(brain_path, None)
                 if ob is None:
                     # Ignore old references to deleted objects.
                     continue



More information about the CMF-checkins mailing list