summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/contents.cc2
-rw-r--r--ftparchive/multicompress.cc6
-rw-r--r--ftparchive/writer.cc5
3 files changed, 5 insertions, 8 deletions
diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc
index a743283b0..8a7adfd8e 100644
--- a/ftparchive/contents.cc
+++ b/ftparchive/contents.cc
@@ -204,7 +204,7 @@ void GenContents::Add(const char *Dir,const char *Package)
Node *Root = &this->Root;
// Drop leading slashes
- while (*Dir == '/' && *Dir != 0)
+ while (*Dir == '/')
Dir++;
// Run over the string and grab out each bit up to and including a /
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index 19e6563e0..f5fe14164 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -56,12 +56,10 @@ static std::vector<APT::Configuration::Compressor>::const_iterator findMatchingC
// MultiCompress::MultiCompress - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Setup the file outputs, compression modes and fork the writer child */
-MultiCompress::MultiCompress(string const &Output,string const &Compress,
- mode_t const &Permissions,bool const &Write) :
- Permissions(Permissions)
+MultiCompress::MultiCompress(string const &Output, string const &Compress,
+ mode_t const &Permissions, bool const &Write) : Outputter{-1}, Permissions(Permissions)
{
Outputs = 0;
- Outputter = -1;
UpdateMTime = 0;
auto const Compressors = APT::Configuration::getCompressors();
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index dbc097af6..078638c41 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -216,9 +216,8 @@ bool FTWScanner::RecursiveScan(string const &Dir)
std::sort(FilesToProcess.begin(), FilesToProcess.end(), [](PairType a, PairType b) {
return a.first < b.first;
});
- for (PairType it : FilesToProcess)
- if (ProcessFile(it.first.c_str(), it.second) != 0)
- return false;
+ if (not std::all_of(FilesToProcess.cbegin(), FilesToProcess.cend(), [](auto &&it) { return ProcessFile(it.first.c_str(), it.second) == 0; }))
+ return false;
FilesToProcess.clear();
return true;
}