File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 190190 return h
191191end
192192
193- function sizehint! (d:: Dict{T} , newsz; shrink:: Bool = true ) where T
193+ function sizehint! (d:: Dict{T} , newsz:: Integer ; shrink:: Bool = true ) where T
194+ newsz = Int (newsz):: Int
194195 oldsz = length (d. slots)
195196 # limit new element count to max_values of the key type
196197 newsz = min (max (newsz, length (d)), max_values (T):: Int )
Original file line number Diff line number Diff line change 294294 @test eq (Dict {Int,Int} (), Dict {AbstractString,AbstractString} ())
295295end
296296
297+ @testset " sizehint!" begin
298+ d = Dict ()
299+ sizehint! (d, UInt (3 ))
300+ @test d == Dict ()
301+ sizehint! (d, 5 )
302+ @test isempty (d)
303+ end
304+
297305@testset " equality special cases" begin
298306 @test Dict (1 => 0.0 ) == Dict (1 => - 0.0 )
299307 @test ! isequal (Dict (1 => 0.0 ), Dict (1 => - 0.0 ))
You can’t perform that action at this time.
0 commit comments