Skip to content

Commit

Permalink
Merge pull request #281 from brharrington/tag-hash-code
Browse files Browse the repository at this point in the history
Make BasicTag.hashCode cheaper.
  • Loading branch information
dmuino committed Sep 21, 2014
2 parents f97b8e7 + e827c8d commit d0b983c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions servo-core/src/main/java/com/netflix/servo/tag/BasicTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.netflix.servo.tag;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;

/**
Expand Down Expand Up @@ -67,7 +66,9 @@ public boolean equals(Object o) {
/** {@inheritDoc} */
@Override
public int hashCode() {
return Objects.hashCode(key, value);
int result = key.hashCode();
result = 31 * result + value.hashCode();
return result;
}

/** {@inheritDoc} */
Expand Down

0 comments on commit d0b983c

Please sign in to comment.