chunkbuffer: targetsize isn't used outside of read()
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 24 Jul 2010 17:23:08 +0200
changeset 11668 f070d284994c
parent 11667 78d1e92ba1c0
child 11669 c47cb3193c53
chunkbuffer: targetsize isn't used outside of read()
mercurial/util.py
--- a/mercurial/util.py	Sat Jul 24 15:21:39 2010 +0200
+++ b/mercurial/util.py	Sat Jul 24 17:23:08 2010 +0200
@@ -916,14 +916,13 @@
         targetsize is how big a buffer to try to maintain."""
         self.iter = iter(in_iter)
         self.buf = ''
-        self.targetsize = 2**16
 
     def read(self, l):
         """Read L bytes of data from the iterator of chunks of data.
         Returns less than L bytes if the iterator runs dry."""
         if l > len(self.buf) and self.iter:
-            # Clamp to a multiple of self.targetsize
-            targetsize = max(l, self.targetsize)
+            # Clamp to a multiple of 2**16
+            targetsize = max(l, 2**16)
             collector = [str(self.buf)]
             collected = len(self.buf)
             for chunk in self.iter: