From 1f54f10977379854102a0796dde712a35fe032f3 Mon Sep 17 00:00:00 2001 From: Tortar <68152031+Tortar@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:18:06 +0200 Subject: [PATCH] Improve performance of sizehint! on BinaryHeap --- src/heaps/binary_heap.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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