From 7a1c77f62bf4a16d3cd482d479e92e1cd4b1354b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 7 Jul 2024 01:33:17 +0200 Subject: [PATCH] refactor: remove duplicate code in fixed-queue.ts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/fixed-queue.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/fixed-queue.ts b/src/fixed-queue.ts index 42034e2f..e9003f70 100644 --- a/src/fixed-queue.ts +++ b/src/fixed-queue.ts @@ -21,16 +21,4 @@ export class FixedQueue 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 - } } -- 2.34.1