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

login
register
mail settings
Submitter phabricator
Date Aug. 8, 2018, 12:22 a.m.
Message ID <63fa7d2d3873020891ea1d9e5bfce080@localhost.localdomain>
Download mbox | patch
Permalink /patch/33412/
State Not Applicable
Headers show

Comments

phabricator - Aug. 8, 2018, 12:22 a.m.
quark updated this revision to Diff 10066.

REPOSITORY
  rHG Mercurial

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

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

AFFECTED FILES
  mercurial/linelog.py

CHANGE DETAILS




To: quark, #hg-reviewers, indygreg
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