Skip to content

Commit

Permalink
Improve performance of sizehint! on BinaryHeap
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Apr 17, 2024
1 parent 3be0527 commit 1f54f10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/heaps/binary_heap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f54f10

Please sign in to comment.