diff options
author | Nathan Harmata <nharmata@google.com> | 2015-08-10 16:35:51 +0000 |
---|---|---|
committer | Laszlo Csomor <laszlocsomor@google.com> | 2015-08-11 07:51:52 +0000 |
commit | 1b5c327ea2d897b344ecb1cb897bcb8eee0a5774 (patch) | |
tree | 0e31b4d67b164d08e5e8638be5c5cee2f127ad91 /src/main/java/com/google/devtools | |
parent | 5977735df863b18979285ec288cbdce723b9ce26 (diff) |
Add clarification about hash codes of 0.
--
MOS_MIGRATED_REVID=100285082
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/SkyKey.java | 3 |
1 files changed, 2 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 d297c52186..6916e663e7 100644 --- a/src/main/java/com/google/devtools/build/skyframe/SkyKey.java +++ b/src/main/java/com/google/devtools/build/skyframe/SkyKey.java @@ -67,7 +67,8 @@ public final class SkyKey implements Serializable { // things going on here: // // (1) We use a value of 0 to indicate that the hash code hasn't been computed and cached yet. - // Yes, this means that if the hash code is really 0 then we will "recompute" it each time. + // Yes, this means that if the hash code is really 0 then we will "recompute" it each time. But + // this isn't a problem in practice since a hash code of 0 should be rare. // // (2) Since we have no synchronization, multiple threads can race here thinking there are the // first one to compute and cache the hash code. |