From 31955bc4cfe33bd643a866e3bbfc25bbc1e36edc Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 3 Jan 2021 20:19:28 -0800 Subject: Fixed minor issue with ResourceMappingImpl::ResMappingHashKey::operator== --- Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp b/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp index 39631e7e..e8e04bb1 100644 --- a/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp +++ b/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp @@ -108,7 +108,16 @@ private: bool operator==(const ResMappingHashKey& RHS) const { - return static_cast(*this) == static_cast(RHS) && ArrayIndex == RHS.ArrayIndex; + if (ArrayIndex != RHS.ArrayIndex) + { + // We must check array index first because TBase::operator==() + // expects that if the hashes are different, the strings must be + // different too. This will not be the case for different array + // elements of the same variable. + return false; + } + + return static_cast(*this) == static_cast(RHS); } const Uint32 ArrayIndex; -- cgit v1.2.3