diff --git a/Project.toml b/Project.toml index bd3ee09d2..726f25489 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DataStructures" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.9" +version = "0.18.10" [deps] diff --git a/src/heaps/arrays_as_heaps.jl b/src/heaps/arrays_as_heaps.jl index 47af9e4bc..39a7e53f3 100644 --- a/src/heaps/arrays_as_heaps.jl +++ b/src/heaps/arrays_as_heaps.jl @@ -45,7 +45,7 @@ function percolate_up!(xs::AbstractArray, i::Integer, x=xs[i], o::Ordering=Forwa xs[i] = x end -percolate_up!(xs::AbstractArray, i::Integer, o::Ordering) = percolate_up!(xs, i, xs[i], o) +@inline percolate_up!(xs::AbstractArray, i::Integer, o::Ordering) = percolate_up!(xs, i, xs[i], o) """ heappop!(v, [ord]) @@ -68,7 +68,7 @@ end Given a binary heap-ordered array, push a new element `x`, preserving the heap property. For efficiency, this function does not check that the array is indeed heap-ordered. """ -function heappush!(xs::AbstractArray, x, o::Ordering=Forward) +@inline function heappush!(xs::AbstractArray, x, o::Ordering=Forward) push!(xs, x) percolate_up!(xs, length(xs), o) return xs diff --git a/src/heaps/binary_heap.jl b/src/heaps/binary_heap.jl index 2b399f863..9edf718ab 100644 --- a/src/heaps/binary_heap.jl +++ b/src/heaps/binary_heap.jl @@ -87,7 +87,7 @@ Base.isempty(h::BinaryHeap) = isempty(h.valtree) Adds the `value` element to the heap `h`. """ -function Base.push!(h::BinaryHeap, v) +@inline function Base.push!(h::BinaryHeap, v) heappush!(h.valtree, v, h.ordering) return h end