[Zope-Checkins] CVS: Zope/lib/python/BDBStorage -
BDBFullStorage.py:1.78
Barry Warsaw
barry at zope.com
Mon Dec 29 17:03:01 EST 2003
Update of /cvs-repository/Zope/lib/python/BDBStorage
In directory cvs.zope.org:/tmp/cvs-serv27502
Modified Files:
BDBFullStorage.py
Log Message:
_search_before(): Removed some code that was impossible to reach.
=== Zope/lib/python/BDBStorage/BDBFullStorage.py 1.77 => 1.78 ===
--- Zope/lib/python/BDBStorage/BDBFullStorage.py:1.77 Wed Dec 24 11:02:06 2003
+++ Zope/lib/python/BDBStorage/BDBFullStorage.py Mon Dec 29 17:03:00 2003
@@ -924,7 +924,7 @@
self._lock_acquire()
try:
# Get the current revision information for the object. As per the
- # protocol, let Key errors percolate up.
+ # protocol, let KeyErrors percolate up.
tid = self._getTid(oid)
return self._load(oid, tid, version)
finally:
@@ -950,7 +950,8 @@
assert cur_tid < tid
data, tid, ver = self._load(oid, cur_tid, "")
return data, cur_tid, None
-
+ # p is the transaction after the one we're looking for.
+ # Grab its tid to use as the end tid return value.
next_tid = p[0][8:]
return self._search_before(c, oid, tid, next_tid)
finally:
@@ -968,18 +969,14 @@
# there is no matching record.
if key[:8] != oid:
return None
- # It's possible that the range search hits oid, tid + 1 exactly,
- # but only the first time.
- if key == oid + tid:
- return self._noncurrent_search(c, oid, tid, tid)
vid, nvrevid, lrevid = unpack(">8s8s8s", rec[:24])
if vid == ZERO:
revid = lrevid
else:
revid = nvrevid
data = self._pickles[oid+revid]
- tid = key[8:]
- return data, tid, end_tid
+ start_tid = key[8:]
+ return data, start_tid, end_tid
def _getTidMissingOk(self, oid):
# For the object, return the curent serial number and transaction id
More information about the Zope-Checkins
mailing list