Skip to content

Commit f2628b7

Browse files
authored
Merge pull request #747 from ChrisRackauckas/inference
inline a bit to remove an inference trigger
2 parents 2c18185 + 08ae3a7 commit f2628b7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DataStructures"
22
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
3-
version = "0.18.9"
3+
version = "0.18.10"
44

55

66
[deps]

src/heaps/arrays_as_heaps.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function percolate_up!(xs::AbstractArray, i::Integer, x=xs[i], o::Ordering=Forwa
4545
xs[i] = x
4646
end
4747

48-
percolate_up!(xs::AbstractArray, i::Integer, o::Ordering) = percolate_up!(xs, i, xs[i], o)
48+
@inline percolate_up!(xs::AbstractArray, i::Integer, o::Ordering) = percolate_up!(xs, i, xs[i], o)
4949

5050
"""
5151
heappop!(v, [ord])
@@ -68,7 +68,7 @@ end
6868
Given a binary heap-ordered array, push a new element `x`, preserving the heap property.
6969
For efficiency, this function does not check that the array is indeed heap-ordered.
7070
"""
71-
function heappush!(xs::AbstractArray, x, o::Ordering=Forward)
71+
@inline function heappush!(xs::AbstractArray, x, o::Ordering=Forward)
7272
push!(xs, x)
7373
percolate_up!(xs, length(xs), o)
7474
return xs

src/heaps/binary_heap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Base.isempty(h::BinaryHeap) = isempty(h.valtree)
8787
8888
Adds the `value` element to the heap `h`.
8989
"""
90-
function Base.push!(h::BinaryHeap, v)
90+
@inline function Base.push!(h::BinaryHeap, v)
9191
heappush!(h.valtree, v, h.ordering)
9292
return h
9393
end

0 commit comments

Comments
 (0)