summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/configuration.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib/configuration.cc')
-rw-r--r--apt-pkg/contrib/configuration.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index 997ef7423..931df9f6c 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -32,6 +32,7 @@
#include <algorithm>
#include <fstream>
#include <iterator>
+#include <numeric>
#include <sstream>
#include <stack>
#include <string>
@@ -1149,10 +1150,10 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool const &AsSectio
bool ReadConfigDir(Configuration &Conf,const string &Dir,
bool const &AsSectional, unsigned const &Depth)
{
- bool good = true;
- for (auto const &I : GetListOfFilesInDir(Dir, "conf", true, true))
- good = ReadConfigFile(Conf, I, AsSectional, Depth) && good;
- return good;
+ auto const files = GetListOfFilesInDir(Dir, "conf", true, true);
+ return std::accumulate(files.cbegin(), files.cend(), true, [&](bool good, auto const &file) {
+ return ReadConfigFile(Conf, file, AsSectional, Depth) && good;
+ });
}
/*}}}*/
// MatchAgainstConfig Constructor /*{{{*/