From c5b435c47ba1bbda9f30a5f5b7c9e179d1e9a484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 20 Apr 2012 12:11:22 +0200 Subject: [PATCH] Don't loop through rows and cols where it's not necessary. --- src/Math/Matrix.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Math/Matrix.h b/src/Math/Matrix.h index 5baa1ff34..779c90f9f 100644 --- a/src/Math/Matrix.h +++ b/src/Math/Matrix.h @@ -142,9 +142,8 @@ template class Matrix { /** @brief Equality operator */ inline bool operator==(const Matrix& other) const { - for(size_t row = 0; row != size; ++row) - for(size_t col = 0; col != size; ++col) - if(!TypeTraits::equals((*this)[col][row], other[col][row])) return false; + for(size_t i = 0; i != size*size; ++i) + if(!TypeTraits::equals(_data[i], other._data[i])) return false; return true; }