Mercurial > hg-stable
diff mercurial/revlog.py @ 29744: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 | d0ae5b8f80dc |
children | dae97049345b |
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']