absorb: avoid using a list comprehension to fill a list with fixed values
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 27 Dec 2019 17:53:56 -0500
changeset 43983 236cec445be2
parent 43982 bd3fa45c0662
child 43984 3622f4fafd35
absorb: 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/D7751
hgext/absorb.py
--- a/hgext/absorb.py	Fri Dec 27 16:57:28 2019 -0500
+++ b/hgext/absorb.py	Fri Dec 27 17:53:56 2019 -0500
@@ -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):