From: Zac Medico Date: Mon, 19 Feb 2007 07:08:17 +0000 (-0000) Subject: Make digraph._merge_order_bias() operate on a single digraph that's passed in. X-Git-Tag: v2.2_pre1~1676 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=22f6dca5b85430ed7e47b25bd9cb846938095da0;p=portage.git Make digraph._merge_order_bias() operate on a single digraph that's passed in. svn path=/main/trunk/; revision=6012 --- diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 2ce384d46..5567bb3e0 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -1971,15 +1971,15 @@ class depgraph: break return acceptable - def _merge_order_bias(self, nodes): + def _merge_order_bias(self, mygraph): """Order nodes from highest to lowest overall reference count for optimal leaf node selection.""" node_info = {} - for node in self._parent_child_digraph.order: - node_info[node] = len(self.digraph.parent_nodes(node)) + for node in mygraph.order: + node_info[node] = len(mygraph.parent_nodes(node)) def cmp_merge_preference(node1, node2): return node_info[node2] - node_info[node1] - nodes.sort(cmp_merge_preference) + mygraph.order.sort(cmp_merge_preference) def altlist(self, reversed=False): if reversed in self._altlist_cache: @@ -1990,7 +1990,7 @@ class depgraph: self._altlist_cache[reversed] = retlist[:] return retlist mygraph=self.digraph.copy() - self._merge_order_bias(mygraph.order) + self._merge_order_bias(mygraph) myblockers = self.blocker_digraph.copy() retlist=[] circular_blocks = False