diff options
author | janakr <janakr@google.com> | 2018-01-11 12:24:49 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-11 12:26:57 -0800 |
commit | 534191b7f506bb32447c890119789464a469bdf9 (patch) | |
tree | 04c531665014fb9fc1a46348d4d87d6fe8863c34 /src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java | |
parent | b30dfcb639f284d5b43973b6e8742e148f438fbe (diff) |
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
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/BuildConfigurationValue.java | 10 |
1 files changed, 2 insertions, 8 deletions
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<Class<? extends BuildConfiguration.Fragment>> 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<Class<? extends Fragment>> 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<Class<? extends BuildConfiguration.Fragment>> 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; } |