From bb5d86b228984c83011f07de7b012f1fcd48fe0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 7 Jul 2024 17:55:19 +0200 Subject: [PATCH] refactor(priority-queue): cleanup intermediate variables namespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/queues/priority-queue.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 } -- 2.34.1