refactor: remove duplicate code in fixed-queue.ts
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 6 Jul 2024 23:33:17 +0000 (01:33 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 6 Jul 2024 23:33:17 +0000 (01:33 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/fixed-queue.ts

index 42034e2fc887c34b461c7303f8049a2b0351d32f..e9003f70d8623804877170cb4cd9dc8c690a0163 100644 (file)
@@ -21,16 +21,4 @@ export class FixedQueue<T>
     this.nodeArray[index] = { data, priority: priority ?? 0 }
     return ++this.size
   }
-
-  /** @inheritdoc */
-  public get (index: number): T | undefined {
-    if (this.empty() || index >= this.size) {
-      return undefined
-    }
-    index += this.start
-    if (index >= this.capacity) {
-      index -= this.capacity
-    }
-    return this.nodeArray[index].data
-  }
 }