[PATCH 5 of 7] annotate: remove unused variable in calculation of column widths

Yuya Nishihara yuya at tcha.org
Wed Sep 17 10:11:26 CDT 2014


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1409285972 -7200
#      Fri Aug 29 06:19:32 2014 +0200
# Node ID 7ef5ea99b22359027cd33651e87569a4c0aff623
# Parent  9cb724891a846ba60086467e2a2a304eab9ef865
annotate: remove unused variable in calculation of column widths

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -319,10 +319,9 @@ def annotate(ui, repo, *pats, **opts):
         for f, sep in funcmap:
             l = [f(n) for n, dummy in lines]
             if l:
-                sized = [(x, encoding.colwidth(x)) for x in l]
-                ml = max([w for x, w in sized])
-                formats.append([sep + ' ' * (ml - w) + '%s'
-                                for x, w in sized])
+                sizes = [encoding.colwidth(x) for x in l]
+                ml = max(sizes)
+                formats.append([sep + ' ' * (ml - w) + '%s' for w in sizes])
                 pieces.append(l)
 
         for f, p, l in zip(zip(*formats), zip(*pieces), lines):


More information about the Mercurial-devel mailing list