Mercurial > hg
changeset 11668:f070d284994c
chunkbuffer: targetsize isn't used outside of read()
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sat, 24 Jul 2010 17:23:08 +0200 |
parents | 78d1e92ba1c0 |
children | c47cb3193c53 |
files | mercurial/util.py |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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: