Patchwork D4149: linelog: extract `len(self._program)` to a local function

login
register
mail settings
Submitter phabricator
Date Aug. 7, 2018, 2:04 a.m.
Message ID <1f89647fe7903961e546f1809645b847@localhost.localdomain>
Download mbox | patch
Permalink /patch/33373/
State Not Applicable
Headers show

Comments

phabricator - Aug. 7, 2018, 2:04 a.m.
quark updated this revision to Diff 10026.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4149?vs=10024&id=10026

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

AFFECTED FILES
  mercurial/linelog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/linelog.py b/mercurial/linelog.py
--- a/mercurial/linelog.py
+++ b/mercurial/linelog.py
@@ -308,7 +308,8 @@ 
         else:
             a1info = ar.lines[a1]
             a1inst = self._program[a1info._offset]
-        oldproglen = len(self._program)
+        programlen = self._program.__len__
+        oldproglen = programlen()
         appendinst = self._program.append
 
         # insert