diff --git a/Redcraft.Utility/Source/Public/Templates/TypeHash.h b/Redcraft.Utility/Source/Public/Templates/TypeHash.h index 6b2a08f..f6ef5d9 100644 --- a/Redcraft.Utility/Source/Public/Templates/TypeHash.h +++ b/Redcraft.Utility/Source/Public/Templates/TypeHash.h @@ -22,10 +22,10 @@ FORCEINLINE constexpr size_t HashCombine(size_t A) return A; } -/** Combines two hash values to get a third. this function is not commutative. */ -FORCEINLINE constexpr size_t HashCombine(size_t A, size_t C) +/** Combines more hash values to get a new value. this function is not commutative. */ +template requires (true && ... && CConvertibleTo) +FORCEINLINE constexpr size_t HashCombine(size_t A, size_t C, Ts... InOther) { - size_t B = static_cast(0x9E3779B97F4A7C16); A += B; @@ -40,15 +40,7 @@ FORCEINLINE constexpr size_t HashCombine(size_t A, size_t C) B -= C; B -= A; B ^= (A << 10); C -= A; C -= B; C ^= (B >> 15); - return C; -} - -/** Combines more hash values to get a new value. this function is not commutative. */ -template requires (true && ... && CConvertibleTo) -FORCEINLINE constexpr size_t HashCombine(size_t A, size_t C, Ts... InOther) -{ - size_t B = HashCombine(A, C); - return HashCombine(B, InOther...); + return HashCombine(C, InOther...); } /** Overloads the GetTypeHash algorithm for CIntegral. */