From e9771cd7d01e43f61608161e87571bd3773d6599 Mon Sep 17 00:00:00 2001
From: GoldenTails <milestailsprower101n2@gmail.com>
Date: Mon, 8 Jul 2019 08:39:31 -0500
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 4609913b7a..654af6beac 100644
--- a/src/m_fixed.h
+++ b/src/m_fixed.h
@@ -206,14 +206,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
-- 
GitLab