From 2b734a7ec429825c7007c1093883229e069d36c7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jul 2019 15:48:59 +0200 Subject: Apply various suggestions by cppcheck Reported-By: cppcheck --- ftparchive/writer.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ftparchive/writer.cc') 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; } -- cgit v1.2.3