supress knownConditionTrueFalse

This commit is contained in:
gtsoul-tech 2024-11-08 16:05:28 +02:00
parent 5145b6d2ab
commit da8fd7f661
2 changed files with 5 additions and 2 deletions

View File

@ -331,6 +331,7 @@ void buildReachMapping(const build_info &args, vector<NFAStateSet> &reach,
vector<NFAVertex> verts;
verts.reserve(args.num_states);
auto sidat = [&state_ids=state_ids](const NFAVertex &v) {
// cppcheck-suppress knownConditionTrueFalse
return (state_ids.at(v) != NO_STATE);
};
const auto &vr = vertices_range(h);
@ -1218,10 +1219,11 @@ bool hasSquashableInitDs(const build_info &args) {
static
bool hasInitDsStates(const NGHolder &h,
const unordered_map<NFAVertex, u32> &state_ids) {
// cppcheck-suppress knownConditionTrueFalse
if (state_ids.at(h.startDs) != NO_STATE) {
return true;
}
// cppcheck-suppress knownConditionTrueFalse
if (is_triggered(h) && state_ids.at(h.start) != NO_STATE) {
return true;
}
@ -1696,7 +1698,7 @@ static
bool cannotDie(const build_info &args) {
const auto &h = args.h;
const auto &state_ids = args.state_ids;
// cppcheck-suppress knownConditionTrueFalse
// If we have a startDs we're actually using, we can't die.
if (state_ids.at(h.startDs) != NO_STATE) {
DEBUG_PRINTF("is using startDs\n");

View File

@ -512,6 +512,7 @@ set<NFAVertex> findZombies(const NGHolder &h,
}
for (const auto &v : inv_adjacent_vertices_range(h.accept, h)) {
// cppcheck-suppress knownConditionTrueFalse
if (state_ids.at(v) != NO_STATE) {
zombies.insert(v);
}