Update further uses of SipHash

This commit is contained in:
ltrk2 2023-06-23 15:22:21 +00:00
parent 967be3e13c
commit 6b96a3943d
4 changed files with 4 additions and 22 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -160,9 +160,7 @@ UInt128 CompileDAG::hash() const
}
}
UInt128 result;
hash.get128(result);
return result;
return hash.get128();
}
}