Small optimization

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 8820]
This commit is contained in:
parrt 2011-07-02 11:28:30 -08:00
parent ab8d07d82f
commit 919e3a1c06
1 changed files with 2 additions and 1 deletions

View File

@ -101,7 +101,8 @@ public class CommonToken implements Token, Serializable {
if ( input==null ) {
return null;
}
if ( start<input.size() && stop<input.size() ) {
int n = input.size();
if ( start<n && stop<n) {
return input.substring(start,stop);
}
else {