stablerange: use cached size data instead of walking the graph
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 20 Dec 2017 19:47:19 +0100
changeset 3330 a67a586792dc
parent 3329 c056f125e17d
child 3331 846bdf081871
stablerange: use cached size data instead of walking the graph Less iteration is better.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Wed Dec 20 17:56:38 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Dec 20 19:47:19 2017 +0100
@@ -486,12 +486,12 @@
         while 0 < skips:
             jumphead = jumpdest
             currentjump = next(jumps)
-            skipped = size = until(jumphead, currentjump[0])
+            skipped = size = currentjump[2]
             jumpdest = currentjump[1]
             if size == skips:
                 jumphead = jumpdest
                 mainjump = next(jumps)
-                mainsize = until(jumphead, mainjump[0])
+                mainsize = mainjump[2]
             elif skips < size:
                 revs = walkfrom(jumphead)
                 next(revs)
@@ -535,7 +535,7 @@
                 size += mainsize
                 jumphead = mainjump[1]
                 mainjump = next(jumps, None)
-                mainsize = until(jumphead, mainjump[0])
+                mainsize = mainjump[2]
                 ref = next(refjumps, None)
                 if ref is None:
                     # we are doing with section specific to the last merge
@@ -552,7 +552,7 @@
                     size = 0
                     jumphead = rangehead = mainjump[1]
                     mainjump = next(jumps, None)
-                    mainsize = until(jumphead, mainjump[0])
+                    mainsize = mainjump[2]
                     refjumps = None
 
         if tomap: