Simplify ArrayPredictionContext.isEmpty()

This commit is contained in:
Sam Harwell 2013-06-30 15:42:27 -05:00
parent dbe1390c6f
commit 89a251e497
1 changed files with 3 additions and 2 deletions

View File

@ -59,8 +59,9 @@ public class ArrayPredictionContext extends PredictionContext {
@Override
public boolean isEmpty() {
return size()==1 &&
returnStates[0]==EMPTY_RETURN_STATE;
// since EMPTY_RETURN_STATE can only appear in the last position, we
// don't need to verify that size==1
return returnStates[0]==EMPTY_RETURN_STATE;
}
@Override