diff --git a/src/re2parser.cc b/src/re2parser.cc index da10ffac7..03e9f2554 100644 --- a/src/re2parser.cc +++ b/src/re2parser.cc @@ -252,7 +252,7 @@ namespace { } } } - RegexParser::renumber_states(output_nfa, explicit_nfa); + *output_nfa = Nfa(explicit_nfa).trim(); } private: // private methods @@ -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