diff --git a/src/nfa/nfa.cc b/src/nfa/nfa.cc index 26028502b..2b79379eb 100644 --- a/src/nfa/nfa.cc +++ b/src/nfa/nfa.cc @@ -18,9 +18,7 @@ #include #include #include -#include #include -#include // MATA headers #include "mata/utils/sparse-set.hh" @@ -330,10 +328,10 @@ BoolVector Nfa::get_useful_states(bool stop_at_first_useful_state) const { // propagate usefulness to the closed SCC for(const State& st : scc) useful[st] = true; // propagate usefulness to predecessors in @p tarjan_stack - for(const State& st :std::views::reverse(tarjan_stack)) { - if (useful[st]) + for (auto st = tarjan_stack.rbegin(); st != tarjan_stack.rend(); ++st) { + if (useful[*st]) break; - useful[st] = true; + useful[*st] = true; } } }