aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/sanitised_dependencies.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-06 21:10:05 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-06 23:25:05 +0000
commit17713e3263bd523cd60208e221f0cebdbad0f3af (patch)
treec375639137aa3c9809dd47c1ddf9607b7a9b28f0 /paludis/resolver/sanitised_dependencies.cc
parent0c705e0475a6ed144db7b6913493a643e49e20b6 (diff)
downloadpaludis-17713e3263bd523cd60208e221f0cebdbad0f3af.tar.gz
paludis-17713e3263bd523cd60208e221f0cebdbad0f3af.tar.xz
Refactor
Diffstat (limited to 'paludis/resolver/sanitised_dependencies.cc')
-rw-r--r--paludis/resolver/sanitised_dependencies.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index e0d1055..7dfc160 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -253,27 +253,26 @@ namespace
{
/* we've got a choice of groups of packages. pick the best score, left to right. */
std::list<std::list<PackageOrBlockDepSpec> >::const_iterator g_best(child_groups.end());
- int best_score(-1);
+ std::pair<AnyChildScore, OperatorScore> best_score(acs_worse_than_worst, os_worse_than_worst);
for (std::list<std::list<PackageOrBlockDepSpec> >::const_iterator g(child_groups.begin()),
g_end(child_groups.end()) ;
g != g_end ; ++g)
{
- // should match Decider::find_any_score logic:
- // equivalent to an already installed spec with no
- // version operator
- int worst_score(59);
+ /* best possible, to get ( ) right */
+ std::pair<AnyChildScore, OperatorScore> worst_score(acs_already_installed, os_greater_or_none);
/* score of a group is the score of the worst child. */
for (std::list<PackageOrBlockDepSpec>::const_iterator h(g->begin()), h_end(g->end()) ;
h != h_end ; ++h)
{
- int score(decider.find_any_score(our_resolvent, make_sanitised(PackageOrBlockDepSpec(*h))));
- if ((-1 == worst_score) || (score < worst_score))
+ std::pair<AnyChildScore, OperatorScore> score(
+ decider.find_any_score(our_resolvent, make_sanitised(PackageOrBlockDepSpec(*h))));
+ if (score < worst_score)
worst_score = score;
}
- if ((best_score == -1) || (worst_score > best_score))
+ if (worst_score > best_score)
{
best_score = worst_score;
g_best = g;