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): ...@@ -638,16 +638,17 @@ class BTreeDatabaseManager(DatabaseManager):
max_serial = tserial.maxKey(tid) max_serial = tserial.maxKey(tid)
except ValueError: except ValueError:
# No entry before pack TID, nothing to pack on this object. # No entry before pack TID, nothing to pack on this object.
return False pass
if tserial[max_serial][2] == '': else:
# Last version before/at pack TID is a creation undo, drop if tserial[max_serial][2] == '':
# it too. # Last version before/at pack TID is a creation undo, drop
max_serial += 1 # it too.
def serial_callback(serial, _): max_serial += 1
updatePackFuture(oid, serial, max_serial, def serial_callback(serial, _):
updateObjectDataForPack) updatePackFuture(oid, serial, max_serial,
batchDelete(tserial, serial_callback, updateObjectDataForPack)
iter_kw={'max': max_serial, 'excludemax': True}) batchDelete(tserial, serial_callback,
iter_kw={'max': max_serial, 'excludemax': True})
return not tserial return not tserial
batchDelete(self._obj, obj_callback, recycle_subtrees=True) 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