From da1556b818de2829fc72700a15a12424ccf32f16 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 11 Jun 2011 08:51:24 -0700 Subject: [PATCH] serialize_tasks: asap ignore medium_soft earlier This allows us to avoid the less efficient runtime cycle pathway for cases in which an asap node is a leaf if medium_soft deps are ignored. Ths should increase efficiency without changing behavior. --- pym/_emerge/depgraph.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 854fa63fb..37dde2d81 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4940,12 +4940,18 @@ class depgraph(object): # the parent to have been removed from the graph already. asap_nodes = [node for node in asap_nodes \ if mygraph.contains(node)] - for node in asap_nodes: - if not mygraph.child_nodes(node, - ignore_priority=priority_range.ignore_soft): - selected_nodes = [node] - asap_nodes.remove(node) + for i in range(priority_range.SOFT, + priority_range.MEDIUM_SOFT + 1): + ignore_priority = priority_range.ignore_priority[i] + for node in asap_nodes: + if not mygraph.child_nodes(node, + ignore_priority=ignore_priority): + selected_nodes = [node] + asap_nodes.remove(node) + break + if selected_nodes: break + if not selected_nodes and \ not (prefer_asap and asap_nodes): for i in range(priority_range.NONE, -- 2.26.2