Commit 13ea966d authored by Barry Warsaw's avatar Barry Warsaw

_finish(), _abort(): Use a better idiom for looping over rec elements.

parent 54e270fb
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"""An autopacking Berkeley storage without undo and versioning. """An autopacking Berkeley storage without undo and versioning.
""" """
__version__ = '$Revision: 1.1 $'.split()[-2:][0] __version__ = '$Revision: 1.2 $'.split()[-2:][0]
import sys import sys
import struct import struct
...@@ -122,9 +122,7 @@ class Autopack(BerkeleyBase): ...@@ -122,9 +122,7 @@ class Autopack(BerkeleyBase):
c = self._oids.cursor() c = self._oids.cursor()
try: try:
rec = c.first() rec = c.first()
while 1: while rec is not None:
if rec is None:
break
oid, data = rec oid, data = rec
lastrevid = self._serials.get(oid, txn=txn) lastrevid = self._serials.get(oid, txn=txn)
if lastrevid: if lastrevid:
...@@ -151,9 +149,7 @@ class Autopack(BerkeleyBase): ...@@ -151,9 +149,7 @@ class Autopack(BerkeleyBase):
c = self._oids.cursor() c = self._oids.cursor()
try: try:
rec = c.first() rec = c.first()
while 1: while rec is not None:
if rec is None:
break
oid, data = rec oid, data = rec
self._actions.put(tid+oid, DEC, txn=txn) self._actions.put(tid+oid, DEC, txn=txn)
rec = c.next() rec = c.next()
......
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