From: Jérôme Benoit Date: Sun, 7 Jul 2024 15:55:19 +0000 (+0200) Subject: refactor(priority-queue): cleanup intermediate variables namespace X-Git-Tag: v4.0.18~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bb5d86b228984c83011f07de7b012f1fcd48fe0a;p=poolifier.git refactor(priority-queue): cleanup intermediate variables namespace Signed-off-by: Jérôme Benoit --- diff --git a/src/queues/priority-queue.ts b/src/queues/priority-queue.ts index dcfd6fb9..797aadf9 100644 --- a/src/queues/priority-queue.ts +++ b/src/queues/priority-queue.ts @@ -70,7 +70,7 @@ export class PriorityQueue { this.priorityEnabled = enablePriority let head: PriorityQueueNode let tail: PriorityQueueNode - let prevNode: PriorityQueueNode | undefined + let prev: PriorityQueueNode | undefined let node: PriorityQueueNode | undefined = this.tail let buckets = 0 while (node != null) { @@ -78,10 +78,10 @@ export class PriorityQueue { if (buckets === 0) { tail = currentNode } - if (prevNode != null) { - prevNode.next = currentNode + if (prev != null) { + prev.next = currentNode } - prevNode = currentNode + prev = currentNode if (node.next == null) { head = currentNode }