From 9e4b88650d1e1a0981b9627654f1e3979d20b698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Chocholat=C3=BD?= Date: Thu, 4 Jul 2024 12:44:30 +0200 Subject: [PATCH] fix: Reset synchronized iterator after each iteration --- src/nfa/operations.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nfa/operations.cc b/src/nfa/operations.cc index 15eb82068..beaca90f0 100644 --- a/src/nfa/operations.cc +++ b/src/nfa/operations.cc @@ -249,7 +249,7 @@ namespace { } // add moves of S to the sync ex iterator - // TODO: shouldn't we also reset first? + synchronized_iterator.reset(); for (State q: S) { mata::utils::push_back(synchronized_iterator, aut.delta[q]); } @@ -1064,7 +1064,7 @@ Nfa mata::nfa::determinize( } // add moves of S to the sync ex iterator - // TODO: shouldn't we also reset first? + synchronized_iterator.reset(); for (State q: S) { mata::utils::push_back(synchronized_iterator, aut.delta[q]); } @@ -1246,7 +1246,7 @@ std::optional Nfa::get_word_from_complement(const Alphabet* alphabet const auto[macrostate, orig_states] = std::move(worklist.back()); worklist.pop_back(); - // TODO: shouldn't we also reset first? + synchronized_iterator.reset(); for (const State orig_state: orig_states) { mata::utils::push_back(synchronized_iterator, delta[orig_state]); } bool sync_it_advanced{ synchronized_iterator.advance() }; for (const Symbol symbol: get_symbols_to_work_with(*this, alphabet)) {