Mix pointers twice in absl::Hash. PiperOrigin-RevId: 714244777 Change-Id: I832f29fe195d13154469be8292d091291a8f928b
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h index d0c1b5a..b97851a 100644 --- a/absl/hash/internal/hash.h +++ b/absl/hash/internal/hash.h
@@ -460,12 +460,8 @@ // Due to alignment, pointers tend to have low bits as zero, and the next few // bits follow a pattern since they are also multiples of some base value. The // byte swap in WeakMix helps ensure we still have good entropy in low bits. -#if defined(__APPLE__) || defined(__ANDROID__) || defined(_MSC_VER) || \ - defined(ABSL_HAVE_ADDRESS_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER) - // In these build modes, pointers may have less entropy so mix pointers twice. + // Mix pointers twice to ensure we have good entropy in low bits. return H::combine(std::move(hash_state), v, v); -#endif - return H::combine(std::move(hash_state), v); } // AbslHashValue() for hashing nullptr_t