aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google
diff options
context:
space:
mode:
authorGravatar Eric Fellheimer <felly@google.com>2015-11-13 22:11:10 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-11-16 09:02:20 +0000
commitb503be7b2e2e6a1601bff3790e6e292ff9076359 (patch)
tree49363adb352d670532f75d3c24cf9c2564453663 /src/test/java/com/google
parent110b065bf7b53db9d5821323a4bd9dc9b127b244 (diff)
Optimize the hash code function of Pair to minimize varargs expansion.
-- MOS_MIGRATED_REVID=107812527
Diffstat (limited to 'src/test/java/com/google')
-rw-r--r--src/test/java/com/google/devtools/build/lib/util/PairTest.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/util/PairTest.java b/src/test/java/com/google/devtools/build/lib/util/PairTest.java
index a54b256da5..98bebbc867 100644
--- a/src/test/java/com/google/devtools/build/lib/util/PairTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/PairTest.java
@@ -21,8 +21,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import java.util.Objects;
-
/**
* Tests for {@link Pair}.
*/
@@ -37,7 +35,7 @@ public class PairTest {
assertSame(a, p.first);
assertSame(b, p.second);
assertEquals(Pair.of(a, b), p);
- assertEquals(Objects.hash(a, b), p.hashCode());
+ assertEquals(31 * a.hashCode() + b.hashCode(), p.hashCode());
}
@Test