Skip to content

Commit

Permalink
Merge pull request #422 from VeriFIT/use_pointers_for_mutable_subset_…
Browse files Browse the repository at this point in the history
…maps

fix: Use pointers to key-value pair in unordered map #patch
  • Loading branch information
Adda0 authored Jul 12, 2024
2 parents 0a54bb0 + aa2e525 commit e636a4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nfa/operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ std::optional<mata::Word> Nfa::get_word(const Symbol first_epsilon) const {
std::optional<mata::Word> Nfa::get_word_from_complement(const Alphabet* alphabet) const {
if (are_disjoint(initial, final)) { return Word{}; }

std::vector<std::unordered_map<StateSet, State>::const_iterator> worklist{};
std::vector<std::unordered_map<StateSet, State>::const_pointer> worklist{};
std::unordered_map<StateSet, State> subset_map{};
const auto subset_map_end{ subset_map.end() };

Expand All @@ -1232,7 +1232,7 @@ std::optional<mata::Word> Nfa::get_word_from_complement(const Alphabet* alphabet
const State new_initial{ nfa_complete.add_state() };
nfa_complete.initial.insert(new_initial);
auto subset_map_it{ subset_map.emplace(initial, new_initial).first };
worklist.emplace_back(subset_map_it);
worklist.emplace_back(subset_map_it.operator->());

using Iterator = mata::utils::OrdVector<SymbolPost>::const_iterator;
SynchronizedExistentialSymbolPostIterator synchronized_iterator{};
Expand Down Expand Up @@ -1278,7 +1278,7 @@ std::optional<mata::Word> Nfa::get_word_from_complement(const Alphabet* alphabet
continue_complementation = false;
}
subset_map_it = subset_map.emplace(std::move(orig_targets), target_macrostate).first;
worklist.emplace_back(subset_map_it);
worklist.emplace_back(subset_map_it.operator->());
}
nfa_complete.delta.add(macrostate, symbol_advanced_to, target_macrostate);
} else {
Expand Down

0 comments on commit e636a4a

Please sign in to comment.