diff --git a/src/heaps/binary_heap.jl b/src/heaps/binary_heap.jl index f3850d5d6..53fa2a2c6 100644 --- a/src/heaps/binary_heap.jl +++ b/src/heaps/binary_heap.jl @@ -39,7 +39,7 @@ mutable struct BinaryHeap{T, O <: Base.Ordering} <: AbstractHeap{T} end function BinaryHeap{T}(ordering::Base.Ordering, xs::AbstractVector) where T - valtree = heapify(xs, ordering) + valtree = @inline heapify!(copyto!(similar(xs), xs), ordering) new{T, typeof(ordering)}(ordering, valtree) end end