From bb27f80a65b96575308c40b401bec194594b5b1c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 28 Aug 2015 14:10:07 -0400 Subject: [PATCH 1/2] Vec3: Remove a memset call on the this pointer --- Source/Core/VideoBackends/Software/Vec3.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/Software/Vec3.h b/Source/Core/VideoBackends/Software/Vec3.h index a5857ffbd67e..1337ed77c430 100644 --- a/Source/Core/VideoBackends/Software/Vec3.h +++ b/Source/Core/VideoBackends/Software/Vec3.h @@ -158,7 +158,9 @@ class Vec3 void SetZero() { - memset((void*)this, 0, sizeof(float) * 3); + x = 0.0f; + y = 0.0f; + z = 0.0f; } void DoState(PointerWrap &p) From e7875015288bced00014169d8a826659c1c9405b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 28 Aug 2015 14:12:14 -0400 Subject: [PATCH 2/2] Vec3: Simplify operator== code --- Source/Core/VideoBackends/Software/Vec3.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Core/VideoBackends/Software/Vec3.h b/Source/Core/VideoBackends/Software/Vec3.h index 1337ed77c430..da54327fe22e 100644 --- a/Source/Core/VideoBackends/Software/Vec3.h +++ b/Source/Core/VideoBackends/Software/Vec3.h @@ -150,10 +150,7 @@ class Vec3 bool operator==(const Vec3 &other) const { - if (x == other.x && y == other.y && z == other.z) - return true; - else - return false; + return x == other.x && y == other.y && z == other.z; } void SetZero()