From 4d2b748a4c4138535c5d07a84790f4b598e62d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Tue, 4 Sep 2018 19:35:30 +0200 Subject: [PATCH] optimize --- raycastlib.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index 4f18ecd..e0c970c 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -311,8 +311,7 @@ uint16_t sqrtInt(uint_maybe32_t value) profileCall(sqrtInt); uint_maybe32_t result = 0; - - uint_maybe32_t a = value; + uint_maybe32_t a = value; #ifdef RAYCAST_TINY uint_maybe32_t b = 1u << 14; @@ -767,7 +766,7 @@ Vector2D normalize(Vector2D v) Unit l = len(v); - l = l == 0 ? 1 : l; + l = l != 0 ? l : 1; result.x = (v.x * UNITS_PER_SQUARE) / l; result.y = (v.y * UNITS_PER_SQUARE) / l;