first batch of cppcheck disables and a few more stl-ifications,

involving use of accumulate() .
This commit is contained in:
G.E
2024-05-16 23:01:17 +03:00
parent 5ebc19674c
commit d78cfb922e
29 changed files with 81 additions and 12 deletions

View File

@@ -46,6 +46,7 @@
#include <algorithm>
#include <fstream>
#include <numeric>
#include <queue>
#include <boost/graph/boykov_kolmogorov_max_flow.hpp>
@@ -359,6 +360,7 @@ u64a litUniqueness(const string &s) {
static
u64a litCountBits(const ue2_literal &lit) {
u64a n = 0;
// cppcheck-suppress useStlAlgorithm
for (const auto &c : lit) {
n += c.nocase ? 7 : 8;
}
@@ -670,10 +672,11 @@ u64a scoreSet(const set<ue2_literal> &s) {
}
u64a score = 1ULL;
for (const auto &lit : s) {
score += calculateScore(lit);
}
auto cscore = [](u64a z, const ue2_literal &lit) { return z + calculateScore(lit); };
score += std::accumulate(s.begin(), s.end(), 0, cscore);
// for (const auto &lit : s) {
// score += calculateScore(lit);
// }
return score;
}