Commit 1fda5504 authored by Martijn Pieters's avatar Martijn Pieters

Shortcut the case where the path searched for is longer than anything indexed.

parent 2d5e7876
...@@ -173,6 +173,10 @@ class PathIndex(Persistent, SimpleItem): ...@@ -173,6 +173,10 @@ class PathIndex(Persistent, SimpleItem):
for level in xrange(self._depth + 1)]) for level in xrange(self._depth + 1)])
comps = filter(None, path.split('/')) 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: if len(comps) == 0:
return IISet(self._unindex.keys()) return IISet(self._unindex.keys())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment