Improve performance of equals

This commit is contained in:
Sam Harwell 2012-07-18 14:24:47 -05:00
parent 45e42d7243
commit 4c1e9b4119
1 changed files with 1 additions and 3 deletions

View File

@ -52,11 +52,9 @@ public abstract class ContextGetterDecl extends Decl {
*/
@Override
public boolean equals(Object obj) {
if ( obj==null ) return false;
if ( this==obj ) return true;
// A() and label A are different
if ( !(obj instanceof ContextGetterDecl) ) return false;
if ( this==obj ) return true;
if ( this.hashCode() != obj.hashCode() ) return false;
return
name.equals(((Decl) obj).name) &&
getArgType().equals(((ContextGetterDecl) obj).getArgType());