Make the default circular array size a const
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 13 May 2021 17:48:51 +0000 (19:48 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 13 May 2021 17:48:51 +0000 (19:48 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/CircularArray.ts

index 3e489f640fe3f4e0ca92091fb1b8adb32b39458a..c46b06b6cb8983bb2cab53bf1a0e248a0452d005 100644 (file)
@@ -1,11 +1,11 @@
+const DEFAULT_CIRCULAR_ARRAY_SIZE = 2000;
 
 export default class CircularArray<T> extends Array<T> {
   public size: number;
-  private readonly defaultCircularArraySize = 2000;
 
   constructor(size?: number) {
     super();
-    this.size = size ?? this.defaultCircularArraySize;
+    this.size = size ?? DEFAULT_CIRCULAR_ARRAY_SIZE;
   }
 
   public push(...items: T[]): number {