mercurial/util.py
branchstable
changeset 17962 4c29668ca316
parent 17560 9ee25d7b1aed
child 18013 98c867ac1330
--- a/mercurial/util.py	Mon Nov 26 13:44:11 2012 -0600
+++ b/mercurial/util.py	Mon Nov 26 15:42:52 2012 -0600
@@ -899,7 +899,7 @@
         """Read L bytes of data from the iterator of chunks of data.
         Returns less than L bytes if the iterator runs dry."""
         left = l
-        buf = ''
+        buf = []
         queue = self._queue
         while left > 0:
             # refill the queue
@@ -917,11 +917,11 @@
             left -= len(chunk)
             if left < 0:
                 queue.appendleft(chunk[left:])
-                buf += chunk[:left]
+                buf.append(chunk[:left])
             else:
-                buf += chunk
+                buf.append(chunk)
 
-        return buf
+        return ''.join(buf)
 
 def filechunkiter(f, size=65536, limit=None):
     """Create a generator that produces the data in the file size