VideoCommon/ShaderGenCommon: Fix memcmp size in ShaderUid operators

This commit is contained in:
Techjar 2019-05-30 15:56:47 -04:00
parent 00ecfb3c59
commit cd3ba570df
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ public:
bool operator==(const ShaderUid& obj) const bool operator==(const ShaderUid& obj) const
{ {
return memcmp(&data, &obj.data, data.NumValues() * sizeof(data)) == 0; return memcmp(GetUidData(), obj.GetUidData(), GetUidDataSize()) == 0;
} }
bool operator!=(const ShaderUid& obj) const { return !operator==(obj); } bool operator!=(const ShaderUid& obj) const { return !operator==(obj); }
@ -77,7 +77,7 @@ public:
// determines the storage order inside STL containers // determines the storage order inside STL containers
bool operator<(const ShaderUid& obj) const bool operator<(const ShaderUid& obj) const
{ {
return memcmp(&data, &obj.data, data.NumValues() * sizeof(data)) < 0; return memcmp(GetUidData(), obj.GetUidData(), GetUidDataSize()) < 0;
} }
// Returns a pointer to an internally stored object of the uid_data type. // Returns a pointer to an internally stored object of the uid_data type.