Remove unnecessary null checks

This commit is contained in:
Sam Harwell 2013-01-02 13:03:42 -06:00
parent 43c5dd0a67
commit 1f4f850765
1 changed files with 2 additions and 2 deletions

View File

@ -1153,7 +1153,7 @@ public class ParserATNSimulator extends ATNSimulator {
if ( config.state instanceof RuleStopState ) { if ( config.state instanceof RuleStopState ) {
// We hit rule end. If we have context info, use it // We hit rule end. If we have context info, use it
// run thru all possible stack tops in ctx // run thru all possible stack tops in ctx
if ( config.context!=null && !config.context.isEmpty() ) { if ( !config.context.isEmpty() ) {
for (SingletonPredictionContext ctx : config.context) { for (SingletonPredictionContext ctx : config.context) {
if ( ctx.returnState==PredictionContext.EMPTY_RETURN_STATE ) { if ( ctx.returnState==PredictionContext.EMPTY_RETURN_STATE ) {
// we have no context info, just chase follow links (if greedy) // we have no context info, just chase follow links (if greedy)
@ -1200,7 +1200,7 @@ public class ParserATNSimulator extends ATNSimulator {
// optimization // optimization
if ( !p.onlyHasEpsilonTransitions() ) { if ( !p.onlyHasEpsilonTransitions() ) {
configs.add(config, mergeCache); configs.add(config, mergeCache);
if ( config.semanticContext!=null && config.semanticContext!= SemanticContext.NONE ) { if ( config.semanticContext!= SemanticContext.NONE ) {
configs.hasSemanticContext = true; configs.hasSemanticContext = true;
} }
if ( config.reachesIntoOuterContext>0 ) { if ( config.reachesIntoOuterContext>0 ) {