diff --git a/src/Math/Vector.h b/src/Math/Vector.h index e5af334d4..96ed4e9b4 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -159,12 +159,8 @@ template class Vector { } /** @brief Vector length */ - T length() const { - T out(0); - for(size_t i = 0; i != size; ++i) - out += pow(at(i), 2); - - return sqrt(out); + inline T length() const { + return sqrt(operator*(*this)); } /** @brief Normalized vector (of length 1) */