[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/PathIndex - PathIndex.py:1.33

Jeremy Hylton jeremy@zope.com
Thu, 20 Feb 2003 14:48:06 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/PathIndex
In directory cvs.zope.org:/tmp/cvs-serv5056

Modified Files:
	PathIndex.py 
Log Message:
Collector #814: Use IITreeSet for the sets since they may be large.


=== Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py 1.32 => 1.33 ===
--- Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py:1.32	Mon Jan 27 13:59:17 2003
+++ Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	Thu Feb 20 14:48:03 2003
@@ -21,7 +21,7 @@
 
 from BTrees.IOBTree import IOBTree
 from BTrees.OOBTree import OOBTree
-from BTrees.IIBTree import IISet, intersection, union
+from BTrees.IIBTree import IITreeSet, IISet, intersection, union
 from OFS.SimpleItem import SimpleItem
 from zLOG import LOG, ERROR
 from types import StringType, ListType, TupleType
@@ -77,23 +77,23 @@
         self._unindex = IOBTree()
 
 
-    def insertEntry(self,comp,id,level):
-        """
-        k is a path component (generated by splitPath() )
-        v is the documentId
+    def insertEntry(self, comp, id, level):
+        """Insert an entry.
+        
+        comp is a path component (generated by splitPath() )
+        id is the documentId
         level is the level of the component inside the path
         """
 
-        if self._index.has_key(comp)==0:
+        if self._index.has_key(comp) == 0:
             self._index[comp] = IOBTree()
 
-        if self._index[comp].has_key(level)==0:
-            self._index[comp][level] = IISet()
+        if self._index[comp].has_key(level) == 0:
+            self._index[comp][level] = IITreeSet()
 
         self._index[comp][level].insert(id)
-
-        if level > self._depth: self._depth = level
-
+        if level > self._depth:
+            self._depth = level
 
 
     def index_object(self, documentId, obj ,threshold=100):