Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
29743:8d1cdee372e6 | 29744:0806fa2a39d8 |
---|---|
1583 dfh.flush() | 1583 dfh.flush() |
1584 ifh.flush() | 1584 ifh.flush() |
1585 try: | 1585 try: |
1586 # loop through our set of deltas | 1586 # loop through our set of deltas |
1587 chain = None | 1587 chain = None |
1588 while True: | 1588 for chunkdata in iter(lambda: cg.deltachunk(chain), {}): |
1589 chunkdata = cg.deltachunk(chain) | |
1590 if not chunkdata: | |
1591 break | |
1592 node = chunkdata['node'] | 1589 node = chunkdata['node'] |
1593 p1 = chunkdata['p1'] | 1590 p1 = chunkdata['p1'] |
1594 p2 = chunkdata['p2'] | 1591 p2 = chunkdata['p2'] |
1595 cs = chunkdata['cs'] | 1592 cs = chunkdata['cs'] |
1596 deltabase = chunkdata['deltabase'] | 1593 deltabase = chunkdata['deltabase'] |