From 3631c5d6986fd807effd934009c23a57129fa206 Mon Sep 17 00:00:00 2001 From: Orange Date: Fri, 11 Apr 2025 23:10:02 +0300 Subject: [PATCH] replaced with STL relization --- include/omath/mat.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/omath/mat.hpp b/include/omath/mat.hpp index 6b53821..d8cf403 100644 --- a/include/omath/mat.hpp +++ b/include/omath/mat.hpp @@ -9,6 +9,7 @@ #include #include #include "omath/vector3.hpp" +#include #ifdef near @@ -141,12 +142,7 @@ namespace omath [[nodiscard]] constexpr Type Sum() const noexcept { - Type sum = 0; - for (size_t i = 0; i < Rows; ++i) - for (size_t j = 0; j < Columns; ++j) - sum += At(i, j); - - return sum; + return std::accumulate(m_data.begin(), m_data.end(), Type(0)); } constexpr void Clear() noexcept