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

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 17, 2014, 3:11 p.m.
Message ID <7ef5ea99b22359027cd3.1410966686@mimosa>
Download mbox | patch
Permalink /patch/5848/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 17, 2014, 3:11 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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

Patch

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):