aboutsummaryrefslogtreecommitdiff
path: root/src/common/vector_math.h
diff options
context:
space:
mode:
authorHuw Pascoe <huw.pascoe@gmail.com>2017-09-27 00:26:09 +0100
committerHuw Pascoe <huw.pascoe@gmail.com>2017-09-30 09:34:35 +0100
commitda1c8d152285c5ed4b2dcb9915b886555c99610f (patch)
tree016f6866d15fb9a41a15666f492bed352d95b523 /src/common/vector_math.h
parente2a34ccd8925a311edf4d8c04164fa0c569f2ea7 (diff)
Fixed type conversion ambiguity
Diffstat (limited to 'src/common/vector_math.h')
-rw-r--r--src/common/vector_math.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index 2b05f66eef..3f0057d9e5 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -104,8 +104,7 @@ public:
}
template <typename V>
void operator*=(const V& f) {
- x *= f;
- y *= f;
+ *this = *this * f;
}
template <typename V>
Vec2<decltype(T{} / V{})> operator/(const V& f) const {
@@ -262,9 +261,7 @@ public:
}
template <typename V>
void operator*=(const V& f) {
- x *= f;
- y *= f;
- z *= f;
+ *this = *this * f;
}
template <typename V>
Vec3<decltype(T{} / V{})> operator/(const V& f) const {
@@ -478,10 +475,7 @@ public:
}
template <typename V>
void operator*=(const V& f) {
- x *= f;
- y *= f;
- z *= f;
- w *= f;
+ *this = *this * f;
}
template <typename V>
Vec4<decltype(T{} / V{})> operator/(const V& f) const {