Skip to content

Commit

Permalink
replace function call with trim
Browse files Browse the repository at this point in the history
  • Loading branch information
koniksedy committed Oct 31, 2024
1 parent ecc240f commit f706d86
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/re2parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ namespace {
}
}
}
RegexParser::renumber_states(output_nfa, explicit_nfa);
*output_nfa = Nfa(explicit_nfa).trim();
}

private: // private methods
Expand Down Expand Up @@ -440,16 +440,6 @@ namespace {
}
}

/**
* Renumbers the states of the input_nfa to be from <0, numberOfStates>
* @param input_nfa Nfa which states should be renumbered
* @return Equivalent Nfa as input_nfa but trimmed and with states from interval <0, numberOfStates>
*/
static Nfa renumber_states(Nfa* output_nfa, Nfa &input_nfa) {
*output_nfa = Nfa(input_nfa.delta, input_nfa.initial, input_nfa.final).trim();
return *output_nfa;
}

/**
* Gets all states that are mapped to the state (i.e., states that are within epsilon transitions chain)
* @param prog RE2 prog corresponding to the parsed regex
Expand Down

0 comments on commit f706d86

Please sign in to comment.