D7753: annotate: avoid using a list comprehension to fill a list with fixed values
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Sat Dec 28 01:29:58 UTC 2019
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
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):
To: mharbison72, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list