refactor(priority-queue): cleanup intermediate variables namespace
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 7 Jul 2024 15:55:19 +0000 (17:55 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 7 Jul 2024 15:55:19 +0000 (17:55 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/queues/priority-queue.ts

index dcfd6fb91cdcae8a37c37db6a3f60eea1068461b..797aadf9e238f16f9c7336a4a11703c229a79d59 100644 (file)
@@ -70,7 +70,7 @@ export class PriorityQueue<T> {
     this.priorityEnabled = enablePriority
     let head: PriorityQueueNode<T>
     let tail: PriorityQueueNode<T>
-    let prevNode: PriorityQueueNode<T> | undefined
+    let prev: PriorityQueueNode<T> | undefined
     let node: PriorityQueueNode<T> | undefined = this.tail
     let buckets = 0
     while (node != null) {
@@ -78,10 +78,10 @@ export class PriorityQueue<T> {
       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
       }