summaryrefslogtreecommitdiff
path: root/ftparchive/apt-ftparchive.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ftparchive/apt-ftparchive.cc')
-rw-r--r--ftparchive/apt-ftparchive.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index ab6f48d61..9c02e5b87 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -1002,7 +1002,7 @@ static bool Clean(CommandLine &CmdL)
stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare());
string CacheDir = Setup.FindDir("Dir::CacheDir");
-
+
for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); )
{
if(I->BinCacheDB != "")
@@ -1016,15 +1016,11 @@ static bool Clean(CommandLine &CmdL)
if (DB_SRC.Clean() == false)
_error->DumpErrors();
- string CacheDB = I->BinCacheDB;
- string SrcCacheDB = I->SrcCacheDB;
- while(I != PkgList.end() &&
- I->BinCacheDB == CacheDB &&
- I->SrcCacheDB == SrcCacheDB)
- ++I;
+ I = std::find_if(I, PkgList.end(),
+ [&](PackageMap const &PM) { return PM.BinCacheDB != I->BinCacheDB || PM.SrcCacheDB != I->SrcCacheDB;
+ });
}
-
return true;
}
/*}}}*/