From: Jérôme Benoit Date: Thu, 13 May 2021 17:41:40 +0000 (+0200) Subject: Allow unbound circular array size X-Git-Tag: v1.0.1-0~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2541c612bf17b3c2dd3b7cf3c9663c546bd84aaf;p=e-mobility-charging-stations-simulator.git Allow unbound circular array size Signed-off-by: Jérôme Benoit --- 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 {