You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postgres/src/include/utils/hashutils.h

24 lines
444 B

/*
* Utilities for working with hash values.
*
* Portions Copyright (c) 2017, PostgreSQL Global Development Group
*/
#ifndef HASHUTILS_H
#define HASHUTILS_H
/*
* Combine two hash values, resulting in another hash value, with decent bit
* mixing.
*
* Similar to boost's hash_combine().
*/
static inline uint32
hash_combine(uint32 a, uint32 b)
{
a ^= b + 0x9e3779b9 + (a << 6) + (a >> 2);
return a;
}
#endif /* HASHUTILS_H */