[Checkins] SVN:	Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	Shortcut the case where the path searched for is longer than	anything indexed.
    Martijn Pieters 
    mj at zopatista.com
       
    Sun Dec 14 08:25:31 EST 2008
    
    
  
Log message for revision 94050:
  Shortcut the case where the path searched for is longer than anything indexed. 
Changed:
  U   Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
-=-
Modified: Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
===================================================================
--- Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	2008-12-14 10:45:29 UTC (rev 94049)
+++ Zope/trunk/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	2008-12-14 13:25:30 UTC (rev 94050)
@@ -173,6 +173,10 @@
                  for level in xrange(self._depth + 1)])
 
         comps = filter(None, path.split('/'))
+        
+        if level + len(comps) - 1 > self._depth:
+            # Our search is for a path longer than anything in the index
+            return IISet()
 
         if len(comps) == 0:
             return IISet(self._unindex.keys())
    
    
More information about the Checkins
mailing list