[Checkins] SVN:	Zope/branches/2.11/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	Merge r94050 from trunk: shortcut for	path-longer-than-anything-indexed case
    Martijn Pieters 
    mj at zopatista.com
       
    Sun Dec 14 08:27:14 EST 2008
    
    
  
Log message for revision 94051:
  Merge r94050 from trunk: shortcut for path-longer-than-anything-indexed case
Changed:
  U   Zope/branches/2.11/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
-=-
Modified: Zope/branches/2.11/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
===================================================================
--- Zope/branches/2.11/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	2008-12-14 13:25:30 UTC (rev 94050)
+++ Zope/branches/2.11/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	2008-12-14 13:27:14 UTC (rev 94051)
@@ -176,6 +176,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