GS: Use memcmp for GSVector2 comparisons

Single compare-and-branch versus two.
This commit is contained in:
Connor McLaughlin 2022-09-28 20:26:09 +10:00 committed by refractionpcsx2
parent f1cb13fd94
commit f2e6c61bfa
1 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#include "PrecompiledHeader.h"
#include "GSIntrin.h"
#include <cstring>
#pragma once
@ -65,12 +66,12 @@ public:
constexpr bool operator==(const GSVector2T& v) const
{
return x == v.x && y == v.y;
return (std::memcmp(this, &v, sizeof(*this)) == 0);
}
constexpr bool operator!=(const GSVector2T& v) const
{
return x != v.x || y != v.y;
return (std::memcmp(this, &v, sizeof(*this)) != 0);
}
constexpr GSVector2T operator*(const GSVector2T& v) const