From f9b1921b0ef6ba7a3418ee21a0427368728a3a05 Mon Sep 17 00:00:00 2001 From: Dmitrij Naumov <dmitrij@naumov.de> Date: Wed, 13 Sep 2017 16:03:49 +0200 Subject: [PATCH] [MaL] Save for-loop count. --- MathLib/LinAlg/Eigen/EigenVector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MathLib/LinAlg/Eigen/EigenVector.h b/MathLib/LinAlg/Eigen/EigenVector.h index 981139dd595..ffe5221060d 100644 --- a/MathLib/LinAlg/Eigen/EigenVector.h +++ b/MathLib/LinAlg/Eigen/EigenVector.h @@ -93,7 +93,8 @@ public: template<class T_SUBVEC> void add(const std::vector<IndexType> &pos, const T_SUBVEC &sub_vec) { - for (std::size_t i=0; i<pos.size(); ++i) { + auto const length = pos.size(); + for (std::size_t i=0; i<length; ++i) { add(pos[i], sub_vec[i]); } } -- GitLab