We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4daaa15 commit 1df994fCopy full SHA for 1df994f
2 files changed
immut/priority_queue/moon.pkg.json
@@ -2,7 +2,6 @@
2
"import": [
3
"moonbitlang/core/builtin",
4
"moonbitlang/core/iter",
5
- "moonbitlang/core/list",
6
"moonbitlang/core/array",
7
"moonbitlang/core/assertion",
8
"moonbitlang/core/coverage"
immut/priority_queue/priority_queue.mbt
@@ -52,7 +52,13 @@ pub fn to_array[T : Compare](self : ImmutablePriorityQueue[T]) -> Array[T] {
52
match x {
53
Node(v, child) => {
54
arr.push(v)
55
- child.iter(fn(v) { go(v) }) |> ignore
+ loop child {
56
+ Nil => ()
57
+ Cons(x, xs) => {
58
+ go(x)
59
+ continue xs
60
+ }
61
62
}
63
Empty => ()
64
0 commit comments