Patchwork D7751: absorb: 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-nt34rfmlnv5x7nwvd4ue-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44096/
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/D7751

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -511,7 +511,7 @@ 
         if not editedtext:
             raise error.Abort(_(b'empty editor text'))
         # parse edited result
-        contents = [b'' for i in self.fctxs]
+        contents = [b''] * len(self.fctxs)
         leftpadpos = 4
         colonpos = leftpadpos + len(visiblefctxs) + 1
         for l in mdiff.splitnewlines(editedtext):