Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ordered_robin_dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/robin_dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
2 changes: 1 addition & 1 deletion src/swiss_dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
Loading