Skip to content

Commit

Permalink
MONDRIAN
Browse files Browse the repository at this point in the history
   Making a couple of common equals() methods faster.

[git-p4: depot-paths = "//open/mondrian/": change = 8751]
  • Loading branch information
Richard Emberson committed Feb 19, 2007
1 parent 94cc16a commit 76edaf3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/mondrian/olap/OlapElementBase.java
Expand Up @@ -34,8 +34,8 @@ protected OlapElementBase() {
protected abstract Logger getLogger();

public boolean equals(Object o) {
return (o instanceof OlapElement) &&
equals((OlapElement) o);
return (o == this) ||
((o instanceof OlapElement) && equals((OlapElement) o));
}

public boolean equals(OlapElement mdxElement) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/mondrian/rolap/RolapHierarchy.java
Expand Up @@ -241,12 +241,12 @@ protected Logger getLogger() {
}

public boolean equals(Object o) {
if (!(o instanceof RolapHierarchy)) {
return false;
}
if (this == o) {
return true;
}
if (!(o instanceof RolapHierarchy)) {
return false;
}

RolapHierarchy that = (RolapHierarchy)o;
if (sharedHierarchyName == null || that.sharedHierarchyName == null) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/mondrian/rolap/RolapMember.java
Expand Up @@ -334,8 +334,8 @@ public RolapMember getParentMember() {
}

public boolean equals(Object o) {
return (o instanceof RolapMember) &&
equals((RolapMember) o);
return (o == this) ||
((o instanceof RolapMember) && equals((RolapMember) o));
}

public boolean equals(OlapElement o) {
Expand Down

0 comments on commit 76edaf3

Please sign in to comment.