From 1f4f8507654961f6b38160e66977913f7ca735de Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 2 Jan 2013 13:03:42 -0600 Subject: [PATCH] Remove unnecessary null checks --- .../Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java index 4dd543af0..a8e8e07d0 100755 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java @@ -1153,7 +1153,7 @@ public class ParserATNSimulator extends ATNSimulator { if ( config.state instanceof RuleStopState ) { // We hit rule end. If we have context info, use it // run thru all possible stack tops in ctx - if ( config.context!=null && !config.context.isEmpty() ) { + if ( !config.context.isEmpty() ) { for (SingletonPredictionContext ctx : config.context) { if ( ctx.returnState==PredictionContext.EMPTY_RETURN_STATE ) { // we have no context info, just chase follow links (if greedy) @@ -1200,7 +1200,7 @@ public class ParserATNSimulator extends ATNSimulator { // optimization if ( !p.onlyHasEpsilonTransitions() ) { configs.add(config, mergeCache); - if ( config.semanticContext!=null && config.semanticContext!= SemanticContext.NONE ) { + if ( config.semanticContext!= SemanticContext.NONE ) { configs.hasSemanticContext = true; } if ( config.reachesIntoOuterContext>0 ) {