diff --git a/src/Math/Functions.h b/src/Math/Functions.h index 5ba6dd1be..1cdb809fb 100644 --- a/src/Math/Functions.h +++ b/src/Math/Functions.h @@ -242,10 +242,7 @@ template inline typename std::enable_if::value, T return T(1)/std::sqrt(a); } template Vector sqrtInverted(const Vector& a) { - Vector out; - for(std::size_t i = 0; i != size; ++i) - out[i] = T(1)/std::sqrt(a[i]); - return out; + return Vector(T(1))/sqrt(a); } #endif @@ -265,7 +262,7 @@ template inline typename std::enable_if::value, T template Vector clamp(const Vector& value, T min, T max) { Vector out; for(std::size_t i = 0; i != size; ++i) - out[i] = std::min(std::max(value[i], min), max); + out[i] = clamp(value[i], min, max); return out; } #endif