changeset 22452:75e166b82c7a

annotate: remove redundant check for empty list of annotation data It isn't necessary because zip(*pieces) returns [] if pieces are empty, and pieces are empty only if lines are empty.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 29 Aug 2014 05:09:59 +0200
parents 186fd06283b4
children 48791c2bea1c
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Sep 12 14:21:18 2014 -0700
+++ b/mercurial/commands.py	Fri Aug 29 05:09:59 2014 +0200
@@ -323,12 +323,11 @@
                 pieces.append(["%s%s%s" % (sep, ' ' * (ml - w), x)
                                for x, w in sized])
 
-        if pieces:
-            for p, l in zip(zip(*pieces), lines):
-                ui.write("%s: %s" % ("".join(p), l[1]))
-
-            if lines and not lines[-1][1].endswith('\n'):
-                ui.write('\n')
+        for p, l in zip(zip(*pieces), lines):
+            ui.write("%s: %s" % ("".join(p), l[1]))
+
+        if lines and not lines[-1][1].endswith('\n'):
+            ui.write('\n')
 
 @command('archive',
     [('', 'no-decode', None, _('do not pass files through decoders')),