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.cc36
1 files changed, 16 insertions, 20 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index ab6f48d61..196a0668c 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -12,33 +12,33 @@
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cmndline.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/init.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/init.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/private-cmndline.h>
-#include <apt-private/private-output.h>
#include <apt-private/private-main.h>
+#include <apt-private/private-output.h>
#include <algorithm>
#include <climits>
-#include <sys/time.h>
-#include <locale.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <time.h>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
+#include <locale.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <time.h>
-#include "cachedb.h"
-#include "override.h"
#include "apt-ftparchive.h"
+#include "cachedb.h"
#include "multicompress.h"
+#include "override.h"
#include "writer.h"
#include <apti18n.h>
@@ -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;
}
/*}}}*/