diff options
author | Nathan Harmata <nharmata@google.com> | 2015-11-04 00:08:22 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-11-04 16:09:34 +0000 |
commit | 09969fbb0b6dfbb0ae8abe0da4b386c1143ef802 (patch) | |
tree | 94b3b8eee7502ccfde0848520435b5b1c7dca1ea /src/main/java/com/google | |
parent | d75690a473ea7eb85ef6bac2912e9a67de184b61 (diff) |
In SkyKey#equals, check for 'functionName' equality before checking for 'argument' equality. When the two keys are equal we have to check both fields anyways, so we should only consider the case where they are unequal: 'functionName' equality is almost certainly cheaper, so we'd prefer short circuiting on inequality from that cheap check.
--
MOS_MIGRATED_REVID=106989244
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/SkyKey.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/SkyKey.java b/src/main/java/com/google/devtools/build/skyframe/SkyKey.java index 4187555b7f..6e8ec87eae 100644 --- a/src/main/java/com/google/devtools/build/skyframe/SkyKey.java +++ b/src/main/java/com/google/devtools/build/skyframe/SkyKey.java @@ -103,7 +103,7 @@ public final class SkyKey implements Serializable { return false; } SkyKey other = (SkyKey) obj; - return argument.equals(other.argument) && functionName.equals(other.functionName); + return functionName.equals(other.functionName) && argument.equals(other.argument); } public static final Function<SkyKey, Object> NODE_NAME = new Function<SkyKey, Object>() { |