revlog: use `iter(callable, sentinel)` instead of while True
authorAugie Fackler <augie@google.com>
Fri, 05 Aug 2016 15:35:02 -0400
changeset 29732 0806fa2a39d8
parent 29731 8d1cdee372e6
child 29733 bb04f96df51c
revlog: use `iter(callable, sentinel)` instead of while True This is functionally equivalent, but is a little more concise.
mercurial/revlog.py
--- a/mercurial/revlog.py	Fri Aug 05 14:00:56 2016 -0400
+++ b/mercurial/revlog.py	Fri Aug 05 15:35:02 2016 -0400
@@ -1585,10 +1585,7 @@
         try:
             # loop through our set of deltas
             chain = None
-            while True:
-                chunkdata = cg.deltachunk(chain)
-                if not chunkdata:
-                    break
+            for chunkdata in iter(lambda: cg.deltachunk(chain), {}):
                 node = chunkdata['node']
                 p1 = chunkdata['p1']
                 p2 = chunkdata['p2']