phase 1 of addressing cppcheck useStlAlgorithm warnings,

this set only includes fill and copy operations.
This commit is contained in:
G.E
2024-05-14 17:37:38 +03:00
parent 5ebc19674c
commit b541288cd5
19 changed files with 102 additions and 98 deletions

View File

@@ -227,11 +227,13 @@ vector<u32> removeClique(CliqueGraph &cg) {
while (!graph_empty(cg)) {
const vector<u32> &c = cliquesVec.back();
vector<CliqueVertex> dead;
for (const auto &v : vertices_range(cg)) {
if (find(c.begin(), c.end(), cg[v].stateId) != c.end()) {
dead.emplace_back(v);
}
}
auto deads = [&c=c, &cg=cg](const CliqueVertex &v) {
return (find(c.begin(), c.end(), cg[v].stateId) != c.end());
};
const auto &vr = vertices_range(cg);
std::copy_if(begin(vr), end(vr), std::back_inserter(dead), deads);
for (const auto &v : dead) {
clear_vertex(v, cg);
remove_vertex(v, cg);