From 3998b688ab2749eae424e334fc5be4d166d16fa1 Mon Sep 17 00:00:00 2001 From: Nick Krecklow Date: Mon, 11 May 2020 18:36:22 -0500 Subject: [PATCH] splice to ensure shifts never fall behind --- lib/time.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/time.js b/lib/time.js index b515eca..f810ac4 100644 --- a/lib/time.js +++ b/lib/time.js @@ -73,7 +73,7 @@ class TimeTracker { array.push(value) if (array.length > maxLength) { - array.shift() + array.splice(0, array.length - maxLength) } } }