diff mercurial/ancestor.py @ 20555:4add43865a9b

ancestors: remove unnecessary handling of 'left' If one of the initial nodes also is an ancestor then that most be the only ancestor. There is no need for additional bookkeeping.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 24 Feb 2014 22:42:13 +0100
parents 1e5b38a919dd
children 231ccc08670c
line wrap: on
line diff
--- a/mercurial/ancestor.py	Mon Feb 24 22:42:13 2014 +0100
+++ b/mercurial/ancestor.py	Mon Feb 24 22:42:13 2014 +0100
@@ -31,7 +31,7 @@
         poison = 1 << (i + 1)
 
         gca = set()
-        interesting = left = len(nodes)
+        interesting = len(nodes)
         nv = len(seen) - 1
         while nv >= 0 and interesting:
             v = nv
@@ -45,10 +45,8 @@
                     gca.add(v)
                     sv |= poison
                     if v in nodes:
-                        left -= 1
-                        if left <= 1:
-                            # history is linear
-                            return set([v])
+                        # history is linear
+                        return set([v])
             if sv < poison:
                 for p in pfunc(v):
                     sp = seen[p]