]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
do not do the same looping twice
[apt.git] / 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];
    }