Skip to content

Commit bb4a8b6

Browse files
committed
don't overwrite values in by heapifed tree
1 parent 5aa2e2a commit bb4a8b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/heaps/mutable_binary_heap.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ function _make_mutable_binary_heap(ord::Ordering, ty::Type{T}, values) where T
136136
n = length(values)
137137
nodes = Vector{MutableBinaryHeapNode{T}}(undef, n)
138138
nodemap = Vector{Int}(undef, n)
139-
values = heapify!(values, ord)
139+
valtree = heapify!(values, ord)
140140

141141
i::Int = 0
142-
for v in values
142+
for v in valtree
143143
i += 1
144144
@inbounds nodes[i] = MutableBinaryHeapNode{T}(v, i)
145145
@inbounds nodemap[i] = i

0 commit comments

Comments
 (0)