Skip to content

Commit 3f770c4

Browse files
ezbrcopybara-github
authored andcommitted
Mix pointers twice in absl::Hash.
PiperOrigin-RevId: 714244777 Change-Id: I832f29fe195d13154469be8292d091291a8f928b
1 parent 69b5bd1 commit 3f770c4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

absl/hash/internal/hash.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,8 @@ std::enable_if_t<std::is_pointer<T>::value, H> AbslHashValue(H hash_state,
460460
// Due to alignment, pointers tend to have low bits as zero, and the next few
461461
// bits follow a pattern since they are also multiples of some base value. The
462462
// byte swap in WeakMix helps ensure we still have good entropy in low bits.
463-
#if defined(__APPLE__) || defined(__ANDROID__) || defined(_MSC_VER) || \
464-
defined(ABSL_HAVE_ADDRESS_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
465-
// In these build modes, pointers may have less entropy so mix pointers twice.
463+
// Mix pointers twice to ensure we have good entropy in low bits.
466464
return H::combine(std::move(hash_state), v, v);
467-
#endif
468-
return H::combine(std::move(hash_state), v);
469465
}
470466

471467
// AbslHashValue() for hashing nullptr_t

0 commit comments

Comments
 (0)