From 70af93e91542b236dd3acf680cf43334e617dadc Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 20 Apr 2023 20:36:17 -0700 Subject: `AbslHashValue()` applied to a C-style array simply decays the array to a pointer and hashes that, which is very unlikely to be what the author intended. PiperOrigin-RevId: 525923741 Change-Id: I876dbde341f0b0642fa3d10e3f67b0b31d0311bf --- absl/hash/internal/hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'absl/hash') diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h index 7e534d85..e2397968 100644 --- a/absl/hash/internal/hash.h +++ b/absl/hash/internal/hash.h @@ -411,7 +411,7 @@ AbslHashValue(H hash_state, LongDouble value) { // AbslHashValue() for hashing pointers template -H AbslHashValue(H hash_state, T* ptr) { + H AbslHashValue(H hash_state, T* ptr) { auto v = reinterpret_cast(ptr); // 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. -- cgit v1.2.3