From 534191b7f506bb32447c890119789464a469bdf9 Mon Sep 17 00:00:00 2001 From: janakr Date: Thu, 11 Jan 2018 12:24:49 -0800 Subject: Remove BuildConfigurationValue#Key#enableActions field. Saves 8 bytes of memory and some work: BuildOptions#equals and #hashCode already take that value into account, so pulling it out does nothing but slow us down during Key construction. PiperOrigin-RevId: 181645301 --- .../devtools/build/lib/skyframe/BuildConfigurationValue.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java') diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java index b3099ca49d..46e616c17f 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java @@ -70,17 +70,12 @@ public class BuildConfigurationValue implements SkyValue { static final class Key implements SkyKey, Serializable { private final ImmutableSortedSet> fragments; private final BuildOptions buildOptions; - private final boolean enableActions; // If hashCode really is -1, we'll recompute it from scratch each time. Oh well. private volatile int hashCode = -1; Key(ImmutableSortedSet> fragments, BuildOptions buildOptions) { this.fragments = fragments; this.buildOptions = Preconditions.checkNotNull(buildOptions); - // Cache this value for quicker access on .equals() / .hashCode(). We don't cache it inside - // BuildOptions because BuildOptions is mutable, so a cached value there could fall out of - // date while the BuildOptions is being prepared for this key. - this.enableActions = buildOptions.enableActions(); } ImmutableSortedSet> getFragments() { @@ -106,14 +101,13 @@ public class BuildConfigurationValue implements SkyValue { } Key otherConfig = (Key) o; return buildOptions.equals(otherConfig.buildOptions) - && Objects.equals(fragments, otherConfig.fragments) - && enableActions == otherConfig.enableActions; + && Objects.equals(fragments, otherConfig.fragments); } @Override public int hashCode() { if (hashCode == -1) { - hashCode = Objects.hash(fragments, buildOptions, enableActions); + hashCode = Objects.hash(fragments, buildOptions); } return hashCode; } -- cgit v1.2.3