From 5b3e1a0ea014a0ae1352df3b99b9aca16f0223fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 30 Jan 2013 14:35:12 +0100 Subject: [PATCH] Math: save one unneeded initialization in Vector::sum(). --- src/Math/Vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 45c3f2af0..58d9e6d1d 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -455,9 +455,9 @@ template class Vector { /** @brief Sum of values in the vector */ T sum() const { - T out(0); + T out(_data[0]); - for(std::size_t i = 0; i != size; ++i) + for(std::size_t i = 1; i != size; ++i) out += _data[i]; return out;