Patchwork D7753: annotate: avoid using a list comprehension to fill a list with fixed values

login
register
mail settings
Submitter phabricator
Date Dec. 30, 2019, 1:33 p.m.
Message ID <7772c7c1f23a8243ac461300f808726a@localhost.localdomain>
Download mbox | patch
Permalink /patch/44133/
State Not Applicable
Headers show

Comments

phabricator - Dec. 30, 2019, 1:33 p.m.
Closed by commit rHGcd96eccd1ce1: annotate: avoid using a list comprehension to fill a list with fixed values (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7753?vs=18984&id=19013

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7753/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7753

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -559,7 +559,7 @@ 
                 ml = max(sizes)
                 formats.append([sep + b' ' * (ml - w) + b'%s' for w in sizes])
             else:
-                formats.append([b'%s' for x in l])
+                formats.append([b'%s'] * len(l))
             pieces.append(l)
 
         for f, p, n in zip(zip(*formats), zip(*pieces), lines):