From ac1d96cd3acdc4032b25f3a1c94bfc423c2213d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 19 Jun 2024 23:17:58 +0200 Subject: [PATCH] perf: remove unneeded condition check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/fixed-priority-queue.ts | 3 +-- src/pools/abstract-pool.ts | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fixed-priority-queue.ts b/src/fixed-priority-queue.ts index a3de0209..1cc1480a 100644 --- a/src/fixed-priority-queue.ts +++ b/src/fixed-priority-queue.ts @@ -76,8 +76,7 @@ export class FixedPriorityQueue { for (let i = 0; i < this.size; i++) { if (this.nodeArray[index].priority > priority) { this.nodeArray.splice(index, 0, { data, priority }) - this.nodeArray.length !== this.capacity && - (this.nodeArray.length = this.capacity) + this.nodeArray.length = this.capacity inserted = true break } diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 712de0b7..f13a25a9 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1225,7 +1225,6 @@ export abstract class AbstractPool< }) } - /** @inheritDoc */ public mapExecute ( data: Iterable, -- 2.34.1