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

Casey Duncan casey@zope.com
Tue, 27 May 2003 01:02:16 -0400


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

Modified Files:
      Tag: Zope-2_6-branch
	PathIndex.py 
Log Message:
Fix potential PathIndex performance problem 


=== Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py 1.25.6.5 => 1.25.6.6 ===
--- Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py:1.25.6.5	Fri Feb 21 09:41:24 2003
+++ Zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py	Tue May 27 01:02:15 2003
@@ -84,10 +84,10 @@
         level is the level of the component inside the path
         """
 
-        if self._index.has_key(comp)==0:
+        if not self._index.has_key(comp):
             self._index[comp] = IOBTree()
 
-        if self._index[comp].has_key(level)==0:
+        if not self._index[comp].has_key(level):
             self._index[comp][level] = IITreeSet()
 
         self._index[comp][level].insert(id)
@@ -156,10 +156,10 @@
             try:
                 self._index[comp][level].remove(documentId)
 
-                if len(self._index[comp][level])==0:
+                if not self._index[comp][level]:
                     del self._index[comp][level]
 
-                if len(self._index[comp])==0:
+                if not self._index[comp]:
                     del self._index[comp]
             except KeyError:
                 LOG(self.__class__.__name__, ERROR,