From: Jérôme Benoit Date: Wed, 19 Jun 2024 21:17:58 +0000 (+0200) Subject: perf: remove unneeded condition check X-Git-Tag: v4.0.15~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ac1d96cd3acdc4032b25f3a1c94bfc423c2213d4;p=poolifier.git perf: remove unneeded condition check Signed-off-by: Jérôme Benoit --- 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,