Skip to content

Commit

Permalink
Merge branch 'master' into constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokazama authored Jul 21, 2023
2 parents f9df541 + b6427c0 commit 0d2eeea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ordered_dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ isordered(::Type{T}) where {T<:OrderedDict} = true

# conversion between OrderedDict types
function convert(::Type{OrderedDict{K,V}}, d::AbstractDict) where {K,V}
d isa OrderedDict{K, V} && return d
if !isordered(typeof(d))
Base.depwarn("Conversion to OrderedDict is deprecated for unordered associative containers (in this case, $(typeof(d))). Use an ordered or sorted associative type, such as SortedDict and OrderedDict.", :convert)
end
Expand All @@ -112,7 +113,6 @@ function convert(::Type{OrderedDict{K,V}}, d::AbstractDict) where {K,V}
end
return h
end
convert(::Type{OrderedDict{K,V}},d::OrderedDict{K,V}) where {K,V} = d

isslotempty(slot_value::Integer) = slot_value == 0
isslotfilled(slot_value::Integer) = slot_value > 0
Expand Down Expand Up @@ -493,4 +493,4 @@ function Base.map!(f, iter::Base.ValueIterator{<:OrderedDict})
return iter
end

last(h::OrderedDict) = h.keys[end] => h.vals[end]
last(h::OrderedDict) = h.keys[end] => h.vals[end]

0 comments on commit 0d2eeea

Please sign in to comment.