Commits

Benoit Boissinot committed f32b4a7

speed up headsof()

Comments (0)

Files changed (2)

         hds = set(nodes)
         if not hds:
             return hds
-        for n in sorted(nodes, reverse=True):
-            if n in hds:
-                p = self.parents(n)
-                if p:
-                    hds.difference_update(self.nodeset(heads=p))
+        for n in nodes:
+            for p in self.parents(n):
+                hds.discard(p)
         assert hds
         return hds
 

src/discovery_tonfa.py

         self.writer.show("server remaining: %i" % len(allremain))
         remain = len(allremain) < MAX_SAMPLE and allremain or set()
 
+        return common, set()
         return common, remain