mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Update intHash.
This commit is contained in:
parent
3c31139db8
commit
9e105b877c
@ -71,6 +71,20 @@ inline DB::UInt64 intHashCRC32(DB::UInt64 x, DB::UInt64 updated_value)
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename std::enable_if<(sizeof(T) > sizeof(DB::UInt64)), DB::UInt64>::type
|
||||
intHashCRC32(const T & x, DB::UInt64 updated_value)
|
||||
{
|
||||
auto * begin64 = reinterpret_cast<const UInt64 *>(&x);
|
||||
for (size_t i = 0; i < sizeof(T); i += sizeof(UInt64))
|
||||
{
|
||||
updated_value = intHashCRC32(*begin64, updated_value);
|
||||
++begin64;
|
||||
}
|
||||
|
||||
return updated_value;
|
||||
}
|
||||
|
||||
inline UInt32 updateWeakHash32(const DB::UInt8 * pos, size_t size, DB::UInt32 updated_value)
|
||||
{
|
||||
if (size < 8)
|
||||
|
Loading…
Reference in New Issue
Block a user