[PATCH 2 of 2] Minor cleanups

Eric Hopper hopper at omnifarious.org
Sun Sep 4 10:16:27 CDT 2005


Patch subject is complete summary.


1 files changed, 3 insertions(+), 3 deletions(-)
mercurial/util.py |    6 +++---


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Node ID 694160916216281e1485b4b01e259cc0896ef2cc
# Parent  765d6f9a31b9b0ec6ab65920f52221a5db647729
Minor cleanups.

diff -r 765d6f9a31b9 -r 694160916216 mercurial/util.py
--- a/mercurial/util.py	Sun Sep  4 06:33:56 2005
+++ b/mercurial/util.py	Sun Sep  4 14:57:48 2005
@@ -376,8 +376,8 @@
         if not self.iterempty:
             collector = cStringIO.StringIO()
             collector.write(self.buf)
-            reduce(lambda wrt, ch: (wrt(ch) and None) or wrt,
-                   self.in_iter, collector.write)
+            for ch in self.in_iter:
+                collector.write(ch)
             self.buf = collector.getvalue()
             collector.close()
             collector = None
@@ -388,7 +388,7 @@
 
 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 not self.iterempty:
+        if l > len(self.buf) and not self.iterempty:
             # Clamp to a multiple of self.targetsize
             targetsize = self.targetsize * ((l // self.targetsize) + 1)
             collector = cStringIO.StringIO()


More information about the Mercurial mailing list