Skip to content

Commit

Permalink
reduced binary searches
Browse files Browse the repository at this point in the history
  • Loading branch information
samo538 committed Nov 26, 2024
1 parent 178a790 commit d232b58
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/nfa/operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,11 @@ namespace {
working_pair = worklist[worklist_size - 1];
worklist.pop_back();

for (size_t x = 0; x < alph_syms.size(); x++) {
auto symbol_q_ = reverted_nfa.delta[working_pair.second].find(alph_syms[x]);
if (symbol_q_ == reverted_nfa.delta[working_pair.second].end()) {
continue;
}
for (State q: (*symbol_q_).targets.to_vector()) {
if (--matrix[index_fn(x, working_pair.first, q, alph_syms.size(), no_states)] == 0) {
auto symbol_p_ = reverted_nfa.delta[working_pair.first].find(alph_syms[x]);
for (SymbolPost symbol_q_ : reverted_nfa.delta[working_pair.second]) {
Symbol active_sym = symbol_q_.symbol;
for (State q: symbol_q_.targets.to_vector()) {
if (--matrix[index_fn(index_map[active_sym], working_pair.first, q, alph_syms.size(), no_states)] == 0) {
auto symbol_p_ = reverted_nfa.delta[working_pair.first].find(active_sym);
if (symbol_p_ == reverted_nfa.delta[working_pair.first].end()) {
continue;
}
Expand Down

0 comments on commit d232b58

Please sign in to comment.