added cached hashcode check to equals

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 6812]
This commit is contained in:
parrt 2010-04-11 10:55:47 -08:00
parent 2646c177b1
commit 2faaf7bc7f
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@ public class NFAContext {
*/
public boolean equals(Object o) {
NFAContext other = ((NFAContext)o);
if ( this.cachedHashCode != other.cachedHashCode ) {
return false; // can't be same if hash is different
}
if ( this==other ) return true;
// System.out.println("comparing "+this+" with "+other);