changeset 29732:0806fa2a39d8

revlog: use `iter(callable, sentinel)` instead of while True This is functionally equivalent, but is a little more concise.
author Augie Fackler <augie@google.com>
date Fri, 05 Aug 2016 15:35:02 -0400
parents 8d1cdee372e6
children bb04f96df51c
files mercurial/revlog.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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']