From cb4b85b0bdba6a0c43ca62259dcd35fccd38a45a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 15 Feb 2014 14:47:24 +0100 Subject: do not do the same looping twice Git-Dch: Ignore --- apt-pkg/algorithms.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index db1ebd7e3..4d86e5ff8 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -456,14 +456,8 @@ void pkgProblemResolver::MakeScores() */ if (I->CurrentVer != 0 && Cache[I].CandidateVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable()) Score += PrioInstalledAndNotObsolete; - } - - // Now that we have the base scores we go and propagate dependencies - for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I) - { - if (Cache[I].InstallVer == 0) - continue; + // propagate score points along dependencies for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; ++D) Scores[D.TargetPkg()->ID] += DepMap[D->Type]; } -- cgit v1.2.3