From 23fd3347bbc1f7f0b8d2d351d7d8d14a111438c9 Mon Sep 17 00:00:00 2001 From: LeandroSQ Date: Fri, 9 Feb 2024 02:56:26 -0300 Subject: [PATCH] refactor: Removed unnecessary if-statement --- src/rshapes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 58d606b78..f1e4a8ad7 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1523,8 +1523,7 @@ void DrawPolyPro(Vector2 center, Vector2 *points, int pointCount, Color color) rlColor4ub(color.r, color.g, color.b, color.a); for (int i = 0; i < pointCount; i++) { - int j = i + 1; - if (j == pointCount) j = 0; + int j = (i + 1) % pointCount; rlVertex2f(points[i].x, points[i].y); rlVertex2f(center.x, center.y);