Mercurial > hg
diff mercurial/sshserver.py @ 29728:1a29db79a98d
sshserver: 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 14:00:30 -0400 |
parents | 98e8313dcd9e |
children | d34cf260d15b |
line wrap: on
line diff
--- a/mercurial/sshserver.py Fri Aug 05 14:00:22 2016 -0400 +++ b/mercurial/sshserver.py Fri Aug 05 14:00:30 2016 -0400 @@ -69,11 +69,7 @@ pass def groupchunks(self, changegroup): - while True: - d = changegroup.read(4096) - if not d: - break - yield d + return iter(lambda: changegroup.read(4096), '') def sendresponse(self, v): self.fout.write("%d\n" % len(v))