From 8f2817e81370e40389a51e03d0569260f4e7e85a Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 16 Feb 2012 01:36:04 +0000 Subject: [PATCH] math: use const references instead of passing arguments by value in the magic vector swizzling assignment methods. --- src/lol/math/vector.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index e49e3459..78585e18 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -55,7 +55,7 @@ DECLARE_VECTOR_TYPEDEFS(Mat4, mat4) template struct XVec2 { - inline Vec2 operator =(Vec2 that); + inline Vec2 operator =(Vec2 const &that); static int const I = (N >> 4) & 3; static int const J = (N >> 0) & 3; @@ -64,7 +64,7 @@ template struct XVec2 template struct XVec3 { - inline Vec3 operator =(Vec3 that); + inline Vec3 operator =(Vec3 const &that); static int const I = (N >> 8) & 3; static int const J = (N >> 4) & 3; @@ -75,7 +75,7 @@ template struct XVec3 template struct XVec4 { - inline Vec4 operator =(Vec4 that); + inline Vec4 operator =(Vec4 const &that); static int const I = (N >> 12) & 3; static int const J = (N >> 8) & 3; @@ -1012,21 +1012,21 @@ DECLARE_GLOBAL_TYPED_OPS(Vec4) */ template -inline Vec2 XVec2::operator =(Vec2 that) +inline Vec2 XVec2::operator =(Vec2 const &that) { ptr[I] = that[0]; ptr[J] = that[1]; return *this; } template -inline Vec3 XVec3::operator =(Vec3 that) +inline Vec3 XVec3::operator =(Vec3 const &that) { ptr[I] = that[0]; ptr[J] = that[1]; ptr[K] = that[2]; return *this; } template -inline Vec4 XVec4::operator =(Vec4 that) +inline Vec4 XVec4::operator =(Vec4 const &that) { ptr[I] = that[0]; ptr[J] = that[1]; ptr[K] = that[2]; ptr[L] = that[3]; return *this;