diff --git a/src/ordered_robin_dict.jl b/src/ordered_robin_dict.jl index 141a5f75..a1fd8b19 100644 --- a/src/ordered_robin_dict.jl +++ b/src/ordered_robin_dict.jl @@ -170,7 +170,7 @@ function rehash!(h::OrderedRobinDict{K, V}) where {K, V} return h end -function Base.sizehint!(d::OrderedRobinDict, newsz) +function Base.sizehint!(d::OrderedRobinDict, newsz::Integer) oldsz = length(d) # grow at least 25% if newsz < (oldsz*5)>>2 @@ -232,7 +232,7 @@ end function Base.get!(default::Base.Callable, h::OrderedRobinDict{K,V}, key0) where {K,V} index = get(h.dict, key0, -2) index > 0 && return @inbounds h.vals[index] - + v = convert(V, default()) setindex!(h, v, key0) return v diff --git a/src/robin_dict.jl b/src/robin_dict.jl index 529a97cf..874b03cf 100644 --- a/src/robin_dict.jl +++ b/src/robin_dict.jl @@ -225,7 +225,7 @@ function rehash!(h::RobinDict{K,V}, newsz = length(h.keys)) where {K, V} return h end -function Base.sizehint!(d::RobinDict, newsz) +function Base.sizehint!(d::RobinDict, newsz::Integer) newsz = _tablesz(newsz*2) # *2 for keys and values in same array oldsz = length(d.keys) # grow at least 25% diff --git a/src/swiss_dict.jl b/src/swiss_dict.jl index e742dfb5..25be7c5c 100644 --- a/src/swiss_dict.jl +++ b/src/swiss_dict.jl @@ -274,7 +274,7 @@ function maybe_rehash_shrink!(h::SwissDict) end end -function Base.sizehint!(d::SwissDict, newsz) +function Base.sizehint!(d::SwissDict, newsz::Integer) newsz = _tablesz(newsz*2) # *2 for keys and values in same array oldsz = length(d.keys) # grow at least 25%