From 2ccf91fbfc155c644f8c8667b5475bc7bdd3b833 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 19 Apr 2024 03:52:21 +0200 Subject: [PATCH] Make FixedRem less laggy by just using the modulo operator. --- src/m_fixed.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/m_fixed.h b/src/m_fixed.h index 4e4c79c65..d67777162 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -121,14 +121,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedDiv(fixed_t a, fixed_t b) */ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRem(fixed_t x, fixed_t y) { - const boolean n = x < 0; - x = abs(x); - while (x >= y) - x -= y; - if (n) - return -x; - else - return x; + return x % y; } /** \brief The FixedSqrt function