insert UInt32 Hashvalue in reverse order on big endian machine

This commit is contained in:
Suzy Wang 2023-04-13 13:51:57 -07:00
parent 5f01b8a2b5
commit e95044f713

View File

@ -331,7 +331,11 @@ public:
void ALWAYS_INLINE insert(Value x)
{
HashValue hash_value = hash(x);
HashValue hash_value;
if constexpr (std::endian::native == std::endian::little)
hash_value = hash(x);
else
hash_value = __builtin_bswap32(hash(x));
if (!good(hash_value))
return;