Commit 8daf4383 authored by Vincent Pelletier's avatar Vincent Pelletier

Avoid duplicating return value computation.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2464 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 30f7996a
......@@ -638,16 +638,17 @@ class BTreeDatabaseManager(DatabaseManager):
max_serial = tserial.maxKey(tid)
except ValueError:
# No entry before pack TID, nothing to pack on this object.
return False
if tserial[max_serial][2] == '':
# Last version before/at pack TID is a creation undo, drop
# it too.
max_serial += 1
def serial_callback(serial, _):
updatePackFuture(oid, serial, max_serial,
updateObjectDataForPack)
batchDelete(tserial, serial_callback,
iter_kw={'max': max_serial, 'excludemax': True})
pass
else:
if tserial[max_serial][2] == '':
# Last version before/at pack TID is a creation undo, drop
# it too.
max_serial += 1
def serial_callback(serial, _):
updatePackFuture(oid, serial, max_serial,
updateObjectDataForPack)
batchDelete(tserial, serial_callback,
iter_kw={'max': max_serial, 'excludemax': True})
return not tserial
batchDelete(self._obj, obj_callback, recycle_subtrees=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment