MySQL 8.0.40
Source Code Documentation
|
A convenient way to combine two hash values. More...
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | MY_FUNCTIONAL_HASH_ROTL32(x, r) (x << r) | (x >> (32 - r)) |
Functions | |
template<typename SizeT > | |
void | my_hash_combine (SizeT &seed, SizeT value) |
void | my_hash_combine (uint32_t &h1, uint32_t k1) |
void | my_hash_combine (uint64_t &h, uint64_t k) |
A convenient way to combine two hash values.
It was decided to copy (parts of) the boost::hash_combine() implementation instead of using it directly (by including <boost/functional/hash.hpp>) because of the following reasons, raised by Steinar and Tor:
Pros:
Cons:
I could go either way, but my immediate thought is probably that we should copy the Boost implementation into some header, and then prefix it with a warning saying that you shouldn't use this if you need optimal performance or hash distribution.
Steinar
|
inline |
|
inline |
|
inline |