From 2541c612bf17b3c2dd3b7cf3c9663c546bd84aaf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 13 May 2021 19:41:40 +0200 Subject: [PATCH] Allow unbound circular array size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/CircularArray.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/CircularArray.ts b/src/utils/CircularArray.ts index 9fde8be7..3e489f64 100644 --- a/src/utils/CircularArray.ts +++ b/src/utils/CircularArray.ts @@ -1,11 +1,11 @@ export default class CircularArray extends Array { public size: number; - private readonly defaultMaximumCircularArraySize = 2000; + private readonly defaultCircularArraySize = 2000; constructor(size?: number) { super(); - this.size = size && size <= this.defaultMaximumCircularArraySize ? size : this.defaultMaximumCircularArraySize; + this.size = size ?? this.defaultCircularArraySize; } public push(...items: T[]): number { -- 2.34.1