Skip to content

Commit 9245b43

Browse files
committed
fix linked list node iterator
1 parent 441004f commit 9245b43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/client/lib/client/linked-list.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class DoublyLinkedList<T> {
9494
if (node.previous) {
9595
node.previous.next = node.next;
9696
}
97-
}
97+
}
9898
if (node.next) {
9999
node.next.previous = node.previous;
100100
}
@@ -118,8 +118,9 @@ export class DoublyLinkedList<T> {
118118
*nodes() {
119119
let node = this.#head;
120120
while(node) {
121+
const next = node.next
121122
yield node;
122-
node = node.next;
123+
node = next;
123124
}
124125
}
125126
}

0 commit comments

Comments
 (0)