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

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Mon Dec 30 08:32:06 EST 2019


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

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):



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


More information about the Mercurial-devel mailing list