Use 64-bit for seeded integer hashes

R=petermarshall@chromium.org

Bug: chromium:680662
Change-Id: If48d1043dbe1e1bb695ec890c23e103a6cacf2d4
Reviewed-on: https://chromium-review.googlesource.com/1244220
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56271}
This commit is contained in:
Yang Guo 2018-09-27 14:09:18 +02:00 committed by Commit Bot
parent 48d02e69e0
commit 2c2af0022d

View File

@ -508,11 +508,11 @@ inline uint32_t ComputeLongHash(uint64_t key) {
hash = hash ^ (hash >> 11);
hash = hash + (hash << 6);
hash = hash ^ (hash >> 22);
return static_cast<uint32_t>(hash);
return static_cast<uint32_t>(hash & 0x3fffffff);
}
inline uint32_t ComputeSeededHash(uint32_t key, uint64_t seed) {
return ComputeUnseededHash(key ^ static_cast<uint32_t>(seed));
return ComputeLongHash(static_cast<uint64_t>(key) ^ seed);
}
inline uint32_t ComputePointerHash(void* ptr) {