Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 43990:cd96eccd1ce1
annotate: avoid using a list comprehension to fill a list with fixed values
Flagged by PyCharm as an unused assignment for the variable in the list.
Differential Revision: https://phab.mercurial-scm.org/D7753
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 27 Dec 2019 17:58:17 -0500 |
parents | 6b6872822b32 |
children | 1864efbe90d9 |
comparison
equal
deleted
inserted
replaced
43989:3622f4fafd35 | 43990:cd96eccd1ce1 |
---|---|
557 if fm.isplain(): | 557 if fm.isplain(): |
558 sizes = [encoding.colwidth(x) for x in l] | 558 sizes = [encoding.colwidth(x) for x in l] |
559 ml = max(sizes) | 559 ml = max(sizes) |
560 formats.append([sep + b' ' * (ml - w) + b'%s' for w in sizes]) | 560 formats.append([sep + b' ' * (ml - w) + b'%s' for w in sizes]) |
561 else: | 561 else: |
562 formats.append([b'%s' for x in l]) | 562 formats.append([b'%s'] * len(l)) |
563 pieces.append(l) | 563 pieces.append(l) |
564 | 564 |
565 for f, p, n in zip(zip(*formats), zip(*pieces), lines): | 565 for f, p, n in zip(zip(*formats), zip(*pieces), lines): |
566 fm.startitem() | 566 fm.startitem() |
567 fm.context(fctx=n.fctx) | 567 fm.context(fctx=n.fctx) |