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

@@ -229,11 +229,12 @@ void checkForMultilineStart(ReportManager &rm, NGHolder &g,
/* we need to interpose a dummy dot vertex between v and accept if
* required so that ^ doesn't match trailing \n */
for (const auto &e : out_edges_range(v, g)) {
if (target(e, g) == g.accept) {
dead.emplace_back(e);
}
}
auto deads = [&g=g](const NFAEdge &e) {
return (target(e, g) == g.accept);
};
const auto &er = out_edges_range(v, g);
std::copy_if(begin(er), end(er), std::back_inserter(dead), deads);
/* assert has been resolved; clear flag */
g[v].assert_flags &= ~POS_FLAG_MULTILINE_START;
}