changeset 3575:0facae7566cc

log speedup: use list.extend to avoid an explicit loop
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 28 Oct 2006 20:21:57 -0300
parents 8d87c8d45b3d
children 00427c4b533b
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Oct 28 20:21:56 2006 -0300
+++ b/mercurial/commands.py	Sat Oct 28 20:21:57 2006 -0300
@@ -1816,9 +1816,9 @@
             if not self.quiet:
                 self.write(*args)
         def write(self, *args):
-            self.hunk[self.rev].append(args)
+            self.hunk[self.rev].extend(args)
         def write_header(self, *args):
-            self.header[self.rev].append(args)
+            self.header[self.rev].extend(args)
         def debug(self, *args):
             if self.debugflag:
                 self.write(*args)
@@ -1927,12 +1927,10 @@
         elif st == 'iter':
             if count == limit: break
             if du.header[rev]:
-                for args in du.header[rev]:
-                    ui.write_header(*args)
+                ui.write_header(*du.header[rev])
             if du.hunk[rev]:
                 count += 1
-                for args in du.hunk[rev]:
-                    ui.write(*args)
+                ui.write(*du.hunk[rev])
 
 def manifest(ui, repo, rev=None):
     """output the latest or given revision of the project manifest