splice to ensure shifts never fall behind
This commit is contained in:
@ -73,7 +73,7 @@ class TimeTracker {
|
|||||||
array.push(value)
|
array.push(value)
|
||||||
|
|
||||||
if (array.length > maxLength) {
|
if (array.length > maxLength) {
|
||||||
array.shift()
|
array.splice(0, array.length - maxLength)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user