Remove 2 field accesses per input character in LexerATNSimulator

This commit is contained in:
Sam Harwell 2012-10-29 11:52:45 -05:00
parent 0deadc688a
commit 1269ce8d4e
1 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ public class LexerATNSimulator extends ATNSimulator {
} }
DFAState target = null; DFAState target = null;
if (s.edges != null && t > IntStream.EOF && t < s.edges.length) { if (s.edges != null && t > IntStream.EOF && t <= MAX_DFA_EDGE) {
target = s.edges[t]; target = s.edges[t];
} }
@ -300,7 +300,7 @@ public class LexerATNSimulator extends ATNSimulator {
// that already has lots of edges out of it. e.g., .* in comments. // that already has lots of edges out of it. e.g., .* in comments.
DFAState target = null; DFAState target = null;
ATNConfigSet reach = null; ATNConfigSet reach = null;
if ( s.edges != null && t < s.edges.length && t > IntStream.EOF ) { if ( s.edges != null && t <= MAX_DFA_EDGE && t > IntStream.EOF ) {
closure = s.configs; closure = s.configs;
target = s.edges[t]; target = s.edges[t];
if (target == ERROR) { if (target == ERROR) {