Skip to content

Commit

Permalink
while -> for
Browse files Browse the repository at this point in the history
  • Loading branch information
kilohsakul committed Sep 28, 2023
1 parent 364c6eb commit 44b2fd7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/nfa/nfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ BoolVector Nfa::get_useful_states(bool stop_at_first_useful_state) const {
// rec_call simulates call of the strongconnect. Since c++ cannot do continue over
// multiple loops, we use rec_call to jump to the main loop
bool rec_call = false;
while(act_state_data.current_move != act_state_data.end_move) {
for(;act_state_data.current_move != act_state_data.end_move;act_state_data.current_move++) {
next_state = (*act_state_data.current_move).target;
// if successor is useful, act_state is useful as well
if(useful[next_state]) {
Expand All @@ -264,7 +264,6 @@ BoolVector Nfa::get_useful_states(bool stop_at_first_useful_state) const {
} else if(node_info[next_state].on_stack) {
act_state_data.lowlink = std::min(act_state_data.lowlink, node_info[next_state].index);
}
act_state_data.current_move++;
}
if(rec_call) continue;

Expand Down

0 comments on commit 44b2fd7

Please sign in to comment.