Skip to content

Commit a25bffa

Browse files
authored
Add Integer type annotation to sizehint! overloads (#155)
JuliaLang/julia#59168 made `sizehint!(::ConcreteType, n)` use `::Integer` instead of `::Any` for the second (`n`) argument. This gives OrderedCollections the same behavior.
1 parent a64f186 commit a25bffa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/little_dict.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ end
196196

197197
######## Methods that all mutable AbstractDict's should implement
198198

199-
function Base.sizehint!(dd::UnfrozenLittleDict, sz)
199+
function Base.sizehint!(dd::UnfrozenLittleDict, sz::Integer)
200200
sizehint!(dd.keys, sz)
201201
sizehint!(dd.vals,sz)
202202
return dd

src/little_set.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function Base.copymutable(s::LittleSet{T}) where {T}
111111
LittleSet{T}(new_data)
112112
end
113113

114-
function Base.sizehint!(s::UnfrozenLittleSet, sz)
114+
function Base.sizehint!(s::UnfrozenLittleSet, sz::Integer)
115115
sizehint!(getfield(s, :data), sz)
116116
return s
117117
end

src/ordered_dict.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function rehash!(h::OrderedDict{K,V}, newsz::Integer = length(h.slots)) where {K
212212
return h
213213
end
214214

215-
function sizehint!(d::OrderedDict, newsz)
215+
function sizehint!(d::OrderedDict, newsz::Integer)
216216
slotsz = (newsz*3)>>1
217217
oldsz = length(d.slots)
218218
if slotsz <= oldsz

0 commit comments

Comments
 (0)