Remove duplicate array bounds check

This commit is contained in:
Sam Harwell 2012-10-29 11:42:04 -05:00
parent afed3ac349
commit c34f0d6945
1 changed files with 5 additions and 7 deletions

View File

@ -685,23 +685,21 @@ public class LexerATNSimulator extends ATNSimulator {
@NotNull
DFAState to = addDFAState(q);
// even if we can add the states, we can't add an edge for labels out of range
if (t < 0 || t > MAX_DFA_EDGE) {
return to;
}
if (suppressEdge) {
return to;
}
if ( debug ) System.out.println("EDGE "+from+" -> "+to+" upon "+((char)t));
addDFAEdge(from, t, to);
return to;
}
protected void addDFAEdge(@NotNull DFAState p, int t, @NotNull DFAState q) {
if (t < 0 || t > MAX_DFA_EDGE) return; // Only track edges within the DFA bounds
if ( debug ) {
System.out.println("EDGE "+p+" -> "+q+" upon "+((char)t));
}
DFA dfa = decisionToDFA[mode];
synchronized (dfa) {
if ( p.edges==null ) {