mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Update further uses of SipHash
This commit is contained in:
parent
967be3e13c
commit
6b96a3943d
@ -88,20 +88,6 @@ private:
|
||||
SIPROUND;
|
||||
}
|
||||
|
||||
/// @brief Retrieves the result in some form with the endianness of the platform taken into account.
|
||||
/// @warning This can only be done once!
|
||||
void get128Impl(char * out)
|
||||
{
|
||||
finalize();
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
unalignedStore<UInt64>(out + 8, v0 ^ v1);
|
||||
unalignedStore<UInt64>(out, v2 ^ v3);
|
||||
#else
|
||||
unalignedStore<UInt64>(out, v0 ^ v1);
|
||||
unalignedStore<UInt64>(out + 8, v2 ^ v3);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
/// Arguments - seed.
|
||||
SipHash(UInt64 key0 = 0, UInt64 key1 = 0, bool is_reference_128_ = false) /// NOLINT
|
||||
@ -305,7 +291,7 @@ inline UInt64 sipHash64(const char * data, const size_t size)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
UInt64 sipHash64(const T & x)
|
||||
inline UInt64 sipHash64(const T & x)
|
||||
{
|
||||
SipHash hash;
|
||||
hash.update(x);
|
||||
|
@ -133,8 +133,7 @@ void compileSortDescriptionIfNeeded(SortDescription & description, const DataTyp
|
||||
SipHash sort_description_dump_hash;
|
||||
sort_description_dump_hash.update(description_dump);
|
||||
|
||||
UInt128 sort_description_hash_key;
|
||||
sort_description_dump_hash.get128(sort_description_hash_key);
|
||||
const auto sort_description_hash_key = sort_description_dump_hash.get128();
|
||||
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
|
@ -694,8 +694,7 @@ void Aggregator::compileAggregateFunctionsIfNeeded()
|
||||
SipHash aggregate_functions_description_hash;
|
||||
aggregate_functions_description_hash.update(functions_description);
|
||||
|
||||
UInt128 aggregate_functions_description_hash_key;
|
||||
aggregate_functions_description_hash.get128(aggregate_functions_description_hash_key);
|
||||
const auto aggregate_functions_description_hash_key = aggregate_functions_description_hash.get128();
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
@ -160,9 +160,7 @@ UInt128 CompileDAG::hash() const
|
||||
}
|
||||
}
|
||||
|
||||
UInt128 result;
|
||||
hash.get128(result);
|
||||
return result;
|
||||
return hash.get128();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user