From 524ed70b9d021344434cf7110d1dfba26751cf26 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Mon, 9 Dec 2019 17:17:22 -0500 Subject: [PATCH] refactor FpsCounter index increment GitOrigin-RevId: f8c636747e4ab2cc8e99378e525ab2cde70cadb6 --- Jumpy.Shared/FpsCounter.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Jumpy.Shared/FpsCounter.cs b/Jumpy.Shared/FpsCounter.cs index f811b2a..2fad62c 100644 --- a/Jumpy.Shared/FpsCounter.cs +++ b/Jumpy.Shared/FpsCounter.cs @@ -17,10 +17,7 @@ namespace Jumpy { fps = 1000.0 * frameTimes.Length / timeElapsed; } frameTimes[idx] = now; - idx++; - if (idx == frameTimes.Length) { - idx = 0; - } + idx = (idx + 1) % frameTimes.Length; } } }