Skip to content

Commit b6427c0

Browse files
authored
Merge pull request #96 from chriselrod/patch-1
Remove invalidating method
2 parents d4e7865 + 1277882 commit b6427c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "OrderedCollections"
22
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
3-
version = "1.6.0"
3+
version = "1.6.1"
44

55
[compat]
66
julia = "1.6"

src/ordered_dict.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ isordered(::Type{T}) where {T<:OrderedDict} = true
9898

9999
# conversion between OrderedDict types
100100
function convert(::Type{OrderedDict{K,V}}, d::AbstractDict) where {K,V}
101+
d isa OrderedDict{K, V} && return d
101102
if !isordered(typeof(d))
102103
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)
103104
end
@@ -112,7 +113,6 @@ function convert(::Type{OrderedDict{K,V}}, d::AbstractDict) where {K,V}
112113
end
113114
return h
114115
end
115-
convert(::Type{OrderedDict{K,V}},d::OrderedDict{K,V}) where {K,V} = d
116116

117117
isslotempty(slot_value::Integer) = slot_value == 0
118118
isslotfilled(slot_value::Integer) = slot_value > 0
@@ -493,4 +493,4 @@ function Base.map!(f, iter::Base.ValueIterator{<:OrderedDict})
493493
return iter
494494
end
495495

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

0 commit comments

Comments
 (0)