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

login
register
mail settings
Submitter phabricator
Date Dec. 28, 2019, 1:29 a.m.
Message ID <differential-rev-PHID-DREV-5oxnsva65qvv4ycitgry-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44105/
State Superseded
Headers show

Comments

phabricator - Dec. 28, 2019, 1:29 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Flagged by PyCharm as an unused assignment for the variable in the list.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
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):