]> git.saurik.com Git - apt.git/commitdiff
do not do the same looping twice
authorDavid Kalnischkies <david@kalnischkies.de>
Sat, 15 Feb 2014 13:47:24 +0000 (14:47 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 13 Mar 2014 12:57:34 +0000 (13:57 +0100)
Git-Dch: Ignore

apt-pkg/algorithms.cc

index db1ebd7e3d57fc08387b3338e603bacf69ad75fb..4d86e5ff8488e4cd6005af77a5049305e5559860 100644 (file)
@@ -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];
    }