Skip to content

Commit

Permalink
Improved the hashing function after finding a collision
Browse files Browse the repository at this point in the history
  • Loading branch information
julianstorer committed Dec 15, 2024
1 parent 95cc19e commit 6fc74a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/tracktion_core/utilities/tracktion_Hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ template<typename T>
void hash_combine (size_t& seed, const T& v)
{
static_assert (! std::is_pointer_v<T>, "Using a pointer here is almost certainly incorrect as it will change on each run");
seed ^= std::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
seed ^= std::hash<T>()(v) + 0x9e3779b9 + (seed * 65537u) + (seed / 3u);
}

/** Hashes a range with a default seed and returns the new hash value. */
Expand Down

0 comments on commit 6fc74a8

Please sign in to comment.