chunkbuffer: use for/else to detect end of iteration
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 24 Jul 2010 15:20:29 +0200
changeset 11666 def08249d4db
parent 11665 1f7f8bc45240
child 11667 78d1e92ba1c0
chunkbuffer: use for/else to detect end of iteration
mercurial/util.py
--- a/mercurial/util.py	Sat Jul 24 00:15:29 2010 +0200
+++ b/mercurial/util.py	Sat Jul 24 15:20:29 2010 +0200
@@ -932,7 +932,7 @@
                 collected += len(chunk)
                 if collected >= targetsize:
                     break
-            if collected < targetsize:
+            else:
                 self.iter = False
             self.buf = collector.getvalue()
         if len(self.buf) == l: