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

@@ -32,6 +32,8 @@
*/
#include "config.h"
#include <numeric>
#include "tamaramacompile.h"
@@ -127,9 +129,10 @@ buildTamarama(const TamaInfo &tamaInfo, const u32 queue,
sizeof(u32) * subSize + 64; // offsets to subengines in bytecode and
// padding for subengines
for (const auto &sub : tamaInfo.subengines) {
total_size += ROUNDUP_CL(sub->length);
}
auto subl = [](size_t z, NFA *sub) {
return z + (size_t)(ROUNDUP_CL(sub->length));
};
total_size += std::accumulate(tamaInfo.subengines.begin(), tamaInfo.subengines.end(), 0, subl);
// use subSize as a sentinel value for no active subengines,
// so add one to subSize here