Skip to content

Commit bac2bab

Browse files
committed
fix: tree stringify dead loop
1 parent ec7a862 commit bac2bab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commons/Tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const serialize = <T>(root: TreeNode<T> | null): Array<T | null> => {
55
const queue = [root]
66
const result = []
77

8-
while (queue) {
8+
while (queue.length) {
99
const curr = queue.shift()
1010

1111
if (!curr) {

0 commit comments

Comments
 (0)