From: Jérôme Benoit Date: Sat, 6 Jul 2024 23:33:17 +0000 (+0200) Subject: refactor: remove duplicate code in fixed-queue.ts X-Git-Tag: v4.0.17~1^2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7a1c77f62bf4a16d3cd482d479e92e1cd4b1354b;p=poolifier.git refactor: remove duplicate code in fixed-queue.ts Signed-off-by: Jérôme Benoit --- 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 - } }