Patchwork D7751: absorb: avoid using a list comprehension to fill a list with fixed values

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

Comments

phabricator - Dec. 30, 2019, 1:32 p.m.
Closed by commit rHG236cec445be2: absorb: 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/D7751?vs=18982&id=19011

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

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

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS




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