Commit 73a1c7fd authored by ap@apple.com's avatar ap@apple.com
Browse files

Minimize collisions when hashing pairs

        https://bugs.webkit.org/show_bug.cgi?id=96022

        Build fix (with newer clang?)

        * wtf/HashFunctions.h: (WTF::pairIntHash): Be explicit about casting from
        64 bit to 32 bit.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 04224074
2012-09-14 Alexey Proskuryakov <ap@apple.com>
Minimize collisions when hashing pairs
https://bugs.webkit.org/show_bug.cgi?id=96022
Build fix (with newer clang?)
* wtf/HashFunctions.h: (WTF::pairIntHash): Be explicit about casting from
64 bit to 32 bit.
2012-09-14 Dana Jansens <danakj@chromium.org>
Minimize collisions when hashing pairs
......
......@@ -94,7 +94,7 @@ namespace WTF {
uint64_t longRandom = 19248658165952622LL; // A random 64-bit value.
uint64_t product = longRandom * (shortRandom1 * key1 + shortRandom2 * key2);
unsigned highBits = product >> (sizeof(uint64_t) - sizeof(unsigned));
unsigned highBits = static_cast<unsigned>(product >> (sizeof(uint64_t) - sizeof(unsigned)));
return highBits;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment