[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - Autopack.py:1.2

Barry Warsaw barry@wooz.org
Thu, 18 Jul 2002 12:27:38 -0400


Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv26012

Modified Files:
	Autopack.py 
Log Message:
_finish(), _abort(): Use a better idiom for looping over rec elements.


=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Autopack.py 1.1 => 1.2 ===
             c = self._oids.cursor()
             try:
                 rec = c.first()
-                while 1:
-                    if rec is None:
-                        break
+                while rec is not None:
                     oid, data = rec
                     lastrevid = self._serials.get(oid, txn=txn)
                     if lastrevid:
@@ -151,9 +149,7 @@
             c = self._oids.cursor()
             try:
                 rec = c.first()
-                while 1:
-                    if rec is None:
-                        break
+                while rec is not None:
                     oid, data = rec
                     self._actions.put(tid+oid, DEC, txn=txn)
                     rec = c.next()