Rev 4413: Same gdfo processing, without recursion. in file:///home/vila/src/bzr/reviews/vila-better-heads/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Jun 16 14:48:41 BST 2009


At file:///home/vila/src/bzr/reviews/vila-better-heads/

------------------------------------------------------------
revno: 4413
revision-id: v.ladeuil+lp at free.fr-20090616134841-mu1e58vknaend6dz
parent: v.ladeuil+lp at free.fr-20090616093753-ihx32neot2jqhqqn
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: vila-better-heads
timestamp: Tue 2009-06-16 15:48:41 +0200
message:
  Same gdfo processing, without recursion.
  
  * bzrlib/_known_graph_py.py:
  (KnownGraph._find_gdfo): Push nodes into pending, since the order
  doesn't matter, there is no need to recurse.
-------------- next part --------------
=== modified file 'bzrlib/_known_graph_py.py'
--- a/bzrlib/_known_graph_py.py	2009-06-16 09:37:53 +0000
+++ b/bzrlib/_known_graph_py.py	2009-06-16 13:48:41 +0000
@@ -160,13 +160,15 @@
                 if known_parent_gdfos[child_key] == len(child.parent_keys):
                     # We are the last parent updating that node, we can
                     # continue from there
-                    update_childs(child)
+                    pending.append(child)
 
         for node in self._nodes.itervalues():
             if not node.parent_keys:
                 node.gdfo = 1
                 known_parent_gdfos[node.key] = 0
                 update_childs(node)
+        while pending:
+            update_childs(pending.pop())
 
     def x_find_gdfo(self):
         def find_tails():



More information about the bazaar-commits mailing list