[Zodb-checkins] CVS: ZODB/src/ZODB/FileStorage - FileStorage.py:1.15

Tim Peters tim.one at comcast.net
Thu Apr 22 22:56:29 EDT 2004


Update of /cvs-repository/ZODB/src/ZODB/FileStorage
In directory cvs.zope.org:/tmp/cvs-serv5065/src/ZODB/FileStorage

Modified Files:
	FileStorage.py 
Log Message:
_get_cached_tid():  Python auto-overflows int to long now, so remove the
fiddly code trying to prevent OverflowError.


=== ZODB/src/ZODB/FileStorage/FileStorage.py 1.14 => 1.15 ===
--- ZODB/src/ZODB/FileStorage/FileStorage.py:1.14	Thu Apr 22 22:33:59 2004
+++ ZODB/src/ZODB/FileStorage/FileStorage.py	Thu Apr 22 22:56:26 2004
@@ -406,19 +406,14 @@
         if result is not None:
             self._oid2tid_nhits += 1
 
-        # Log a msg every ~8000 tries, and prevent overflow.
+        # Log a msg every ~8000 tries.
         if self._oid2tid_nlookups & 0x1fff == 0:
-            if self._oid2tid_nlookups >> 30:
-                # In older Pythons, we may overflow if we keep it an int.
-                self._oid2tid_nlookups = long(self._oid2tid_nlookups)
-                self._oid2tid_nhits = long(self._oid2tid_nhits)
             logger.log(BLATHER,
                     "_oid2tid size %s lookups %s hits %s rate %.1f%%",
                     len(self._oid2tid),
                     self._oid2tid_nlookups,
                     self._oid2tid_nhits,
-                    100.0 * self._oid2tid_nhits /
-                            self._oid2tid_nlookups)
+                    100.0 * self._oid2tid_nhits / self._oid2tid_nlookups)
 
         return result
 




More information about the Zodb-checkins mailing list