annotate: remove redundant check for empty list of annotation data
authorYuya Nishihara <yuya@tcha.org>
Fri, 29 Aug 2014 05:09:59 +0200
changeset 22452 75e166b82c7a
parent 22451 186fd06283b4
child 22457 48791c2bea1c
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.
mercurial/commands.py
--- 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')),