[Zope-CVS] CVS: Products/ZCTextIndex - Index.py:1.1.2.35

Guido van Rossum guido@python.org
Mon, 6 May 2002 22:55:18 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv9049

Modified Files:
      Tag: TextIndexDS9-branch
	Index.py 
Log Message:
_{add,del}_wordinfo(): always explicitly store something in
self._wordinfo[wid], otherwise the persistency mechanism doesn't
necessarily know it's been changed!


=== Products/ZCTextIndex/Index.py 1.1.2.34 => 1.1.2.35 ===
             map = self._wordinfo[wid]
         except KeyError:
-            self._wordinfo[wid] = map = {}
+            map = {}
         else:
             # _add_wordinfo() is called for each update.  If the map
             # size exceeds the DICT_CUTOFF, convert to an IIBTree.
             if len(map) == self.DICT_CUTOFF:
-                self._wordinfo[wid] = map = IIBTree(map)
+                map = IIBTree(map)
         map[docid] = f
+        self._wordinfo[wid] = map # Not redundant, because of Persistency!
 
     def _del_wordinfo(self, wid, docid):
         map = self._wordinfo[wid]
@@ -204,7 +205,7 @@
             for k, v in map.items():
                 new[k] = v
             map = new
-        self._wordinfo[wid] = map
+        self._wordinfo[wid] = map # Not redundant, because of Persistency!
 
     def _add_undoinfo(self, docid, wids):
         self._docwords[docid] = wids