summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp11
1 files changed, 10 insertions, 1 deletions
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<const TBase&>(*this) == static_cast<const TBase&>(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<const TBase&>(*this) == static_cast<const TBase&>(RHS);
}
const Uint32 ArrayIndex;