From 71db38cb2ff4b8e2fcd1d3877aed580cf7a4e846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 24 May 2014 16:41:44 +0200 Subject: [PATCH] Math: use Vector::max() instead of custom ugly solution. --- src/Magnum/Math/Quaternion.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index bcc3d68a4..ef08eb062 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -488,10 +488,7 @@ template Quaternion quaternionFromMatrix(const Matrix<3, T>& m) { } /* Diagonal is negative */ - std::size_t i = 0; - if(diagonal[1] > diagonal[0]) i = 1; - if(diagonal[2] > diagonal[i]) i = 2; - + const std::size_t i = diagonal.max(); const std::size_t j = (i + 1) % 3; const std::size_t k = (i + 2) % 3;