From 1269ce8d4e1cdf69ef0c4db232f0cdb667e33738 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Mon, 29 Oct 2012 11:52:45 -0500 Subject: [PATCH] Remove 2 field accesses per input character in LexerATNSimulator --- .../Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java index bf4a7cbe4..8e12dc404 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java @@ -230,7 +230,7 @@ public class LexerATNSimulator extends ATNSimulator { } 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]; } @@ -300,7 +300,7 @@ public class LexerATNSimulator extends ATNSimulator { // that already has lots of edges out of it. e.g., .* in comments. DFAState target = 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; target = s.edges[t]; if (target == ERROR) {