Skip to content

Commit

Permalink
Merge pull request #166 from psiberx/master
Browse files Browse the repository at this point in the history
Fixed HashMap for uint64 keys
  • Loading branch information
wopss authored Jan 6, 2025
2 parents da2f9aa + c409cd7 commit 6289303
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/RED4ext/HashMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ struct HashMapHash<T, std::enable_if_t<std::is_same_v<T, uint64_t>>>
{
uint32_t operator()(const T& aKey) const noexcept
{
// Not 100% sure if this is correct, but checking quickly seems to be the case for 64bit integers.
return static_cast<uint32_t>(aKey) ^ ((aKey >> 32) & 0xFFFFFFFF);
return FNV1a32(reinterpret_cast<const uint8_t*>(&aKey), sizeof(uint64_t));
}
};

Expand Down

0 comments on commit 6289303

Please sign in to comment.