Skip to content

Commit 2dad958

Browse files
bkaminsJeffBezanson
authored andcommitted
remove rehash! from Dict constructor (#24345)
1 parent 52d81b0 commit 2dad958

File tree

3 files changed

+36
-32
lines changed

3 files changed

+36
-32
lines changed

base/dict.jl

+7-11
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ mutable struct Dict{K,V} <: Associative{K,V}
104104
new(zeros(UInt8,n), Array{K,1}(n), Array{V,1}(n), 0, 0, 0, 1, 0)
105105
end
106106
function Dict{K,V}(d::Dict{K,V}) where V where K
107-
if d.ndel > 0
108-
rehash!(d)
109-
end
110-
@assert d.ndel == 0
111-
new(copy(d.slots), copy(d.keys), copy(d.vals), 0, d.count, d.age, d.idxfloor,
112-
d.maxprobe)
107+
new(copy(d.slots), copy(d.keys), copy(d.vals), d.ndel, d.count, d.age,
108+
d.idxfloor, d.maxprobe)
113109
end
114110
end
115111
function Dict{K,V}(kv) where V where K
@@ -346,7 +342,7 @@ end
346342
# get the index where a key is stored, or -pos if not present
347343
# and the key would be inserted at pos
348344
# This version is for use by setindex! and get!
349-
function ht_keyindex2(h::Dict{K,V}, key) where V where K
345+
function ht_keyindex2!(h::Dict{K,V}, key) where V where K
350346
age0 = h.age
351347
sz = length(h.keys)
352348
iter = 0
@@ -393,7 +389,7 @@ function ht_keyindex2(h::Dict{K,V}, key) where V where K
393389

394390
rehash!(h, h.count > 64000 ? sz*2 : sz*4)
395391

396-
return ht_keyindex2(h, key)
392+
return ht_keyindex2!(h, key)
397393
end
398394

399395
@propagate_inbounds function _setindex!(h::Dict, v, key, index)
@@ -424,7 +420,7 @@ end
424420

425421
function setindex!(h::Dict{K,V}, v0, key::K) where V where K
426422
v = convert(V, v0)
427-
index = ht_keyindex2(h, key)
423+
index = ht_keyindex2!(h, key)
428424

429425
if index > 0
430426
h.age += 1
@@ -490,14 +486,14 @@ function get!(default::Callable, h::Dict{K,V}, key0) where V where K
490486
end
491487

492488
function get!(default::Callable, h::Dict{K,V}, key::K) where V where K
493-
index = ht_keyindex2(h, key)
489+
index = ht_keyindex2!(h, key)
494490

495491
index > 0 && return h.vals[index]
496492

497493
age0 = h.age
498494
v = convert(V, default())
499495
if h.age != age0
500-
index = ht_keyindex2(h, key)
496+
index = ht_keyindex2!(h, key)
501497
end
502498
if index > 0
503499
h.age += 1

base/precompile.jl

+21-21
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ precompile(Tuple{typeof(Base.extrema), Array{Int64, 1}})
304304
precompile(Tuple{typeof(Base.Sort.sort_int_range!), Array{Int64, 1}, Int64, Int64})
305305
precompile(Tuple{typeof(Core.Inference.isbits), Base.Sort.QuickSortAlg})
306306
precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##addprocs_locked")), Array{Any, 1}, typeof(Base.Distributed.addprocs_locked), Base.Distributed.LocalManager})
307-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Symbol})
307+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Symbol})
308308
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Symbol, Symbol, Int64})
309309
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Symbol, Symbol}, Base.Pair{Symbol, String}, Base.Pair{Symbol, String}, Base.Pair{Symbol, Base.Cmd}, Base.Pair{Symbol, Bool}})
310310
precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##addprocs")), Array{Any, 1}, typeof(Base.Distributed.addprocs), Base.Distributed.LocalManager})
@@ -319,7 +319,7 @@ precompile(Tuple{typeof(Base.write), Base.Terminals.TerminalBuffer, Array{UInt8,
319319
precompile(Tuple{typeof(Base.LineEdit.keymap), Array{Base.Dict{Any, Any}, 1}})
320320
precompile(Tuple{typeof(Base.LineEdit.add_specialisations), Base.Dict{Char, Any}, Base.Dict{Char, Any}, Int64})
321321
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Base.Dict{Char, Any}, Char})
322-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Char, Any}, Char})
322+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Char, Any}, Char})
323323
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Base.Dict{Char, Any}, Char, Int64})
324324
precompile(Tuple{typeof(Base.setdiff), Base.KeyIterator{Base.Dict{Any, Any}}, Base.KeyIterator{Base.Dict{Any, Any}}})
325325
precompile(Tuple{typeof(Base.LineEdit.keymap_merge), Base.Dict{Char, Any}, Base.Dict{Any, Any}})
@@ -417,7 +417,7 @@ precompile(Tuple{typeof(Base.push!), Array{String, 1}, Base.SubString{String}})
417417
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Char, Char})
418418
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Char, Char, Int64})
419419
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, Int64})
420-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Int64})
420+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Int64})
421421
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, Int64, Int64})
422422
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, String, String})
423423
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, String, String, Int64})
@@ -434,7 +434,7 @@ precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##add_nested_key!")), Array{
434434
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Base.LineEdit.KeyAlias, Char, Int64})
435435
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Base.LineEdit.KeyAlias, Char})
436436
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Void}, Void, String})
437-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Void}, String})
437+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Void}, String})
438438
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Void}, Void, String, Int64})
439439
precompile(Tuple{typeof(Base.LineEdit.fixup_keymaps!), Base.Dict{Char, Any}, Int64, Char, Void})
440440
precompile(Tuple{typeof(Base.LineEdit.run_interface), Base.Terminals.TTYTerminal, Base.LineEdit.ModalInterface})
@@ -449,15 +449,15 @@ precompile(Tuple{typeof(Base.done), Array{Base.LineEdit.TextInterface, 1}, Int64
449449
precompile(Tuple{typeof(Base.next), Array{Base.LineEdit.TextInterface, 1}, Int64})
450450
precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, Base.LineEdit.Prompt})
451451
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.PromptState, Base.LineEdit.Prompt})
452-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.LineEdit.Prompt})
452+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.Prompt})
453453
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.PromptState, Base.LineEdit.Prompt, Int64})
454454
precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}})
455455
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.SearchState, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}})
456-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}})
456+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}})
457457
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.SearchState, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}, Int64})
458458
precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}})
459459
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}})
460-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}})
460+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}})
461461
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}, Int64})
462462
precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Tuple{}, Void}})
463463
precompile(Tuple{typeof(Base.take!), Base.Channel{Any}})
@@ -645,7 +645,7 @@ precompile(Tuple{typeof(Base.is_default_method), Method})
645645
precompile(Tuple{getfield(Base, Symbol("#kw##show")), Array{Any, 1}, typeof(Base.show), Base.GenericIOBuffer{Array{UInt8, 1}}, Method})
646646
precompile(Tuple{typeof(Base.sort!), Array{String, 1}})
647647
precompile(Tuple{typeof(Base.rehash!), Base.Dict{String, Void}, Int64})
648-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{String, Void}, String})
648+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{String, Void}, String})
649649
precompile(Tuple{typeof(Base._setindex!), Base.Dict{String, Void}, Void, String, Int64})
650650
precompile(Tuple{typeof(Base.setindex!), Base.Dict{String, Void}, Void, String})
651651
precompile(Tuple{typeof(Base.Filesystem.realpath), Base.SubString{String}})
@@ -755,7 +755,7 @@ precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{String, String}, String})
755755
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, Tuple{String, String}}, Symbol})
756756
precompile(Tuple{typeof(Base.print), Base.TTY, Char, Char})
757757
precompile(Tuple{typeof(Base.rehash!), Base.Dict{String, String}, Int64})
758-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{String, String}, String})
758+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{String, String}, String})
759759
precompile(Tuple{typeof(Base._setindex!), Base.Dict{String, String}, String, String, Int64})
760760
precompile(Tuple{typeof(Core.Inference.isbits), Base.Dict{String, String}})
761761
precompile(Tuple{typeof(Base.setindex!), Base.Dict{String, String}, String, String})
@@ -797,7 +797,7 @@ precompile(Tuple{Type{Base.Set{Symbol}}, Tuple{Symbol}})
797797
precompile(Tuple{typeof(Base.union!), Base.Set{Symbol}, Tuple{Symbol}})
798798
precompile(Tuple{typeof(Base.unique_from), Array{Any, 1}, Array{Symbol, 1}, Base.Set{Symbol}, Int64})
799799
precompile(Tuple{typeof(Base.convert), Type{Base.Set{Any}}, Base.Set{Symbol}})
800-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Void}, Symbol})
800+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Void}, Symbol})
801801
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Void}, Void, Symbol, Int64})
802802
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Void}, Void, Symbol})
803803
precompile(Tuple{typeof(Base.union!), Base.Set{Any}, Base.Set{Symbol}})
@@ -922,9 +922,9 @@ precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Array{Base.Docs.D
922922
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Docs.Binding, Symbol, Int64})
923923
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Type{Union{}}, Symbol, Int64})
924924
precompile(Tuple{typeof(Base._collect), Array{Base.Docs.DocStr, 1}, Base.Generator{Array{Base.Docs.DocStr, 1}, typeof(Base.Docs.parsedoc)}, Base.EltypeUnknown, Base.HasShape})
925-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Union{DataType, typeof(Type)}, Void}, typeof(Type)})
925+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Void}, typeof(Type)})
926926
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, typeof(Type), Int64})
927-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Union{DataType, typeof(Type)}, Void}, DataType})
927+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Void}, DataType})
928928
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, DataType, Int64})
929929
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, DataType})
930930
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, typeof(Type)})
@@ -1205,7 +1205,7 @@ precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, ty
12051205
precompile(Tuple{typeof(Base.Distributed.send_msg_), Base.Distributed.Worker, Base.Distributed.MsgHeader, Base.Distributed.JoinPGRPMsg, Bool})
12061206
precompile(Tuple{typeof(Base.Distributed.send_msg_now), Base.Distributed.Worker, Base.Distributed.MsgHeader, Base.Distributed.JoinPGRPMsg})
12071207
precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Void}, Int64})
1208-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Int64, Void}, Int64})
1208+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Void}, Int64})
12091209
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Void}, Void, Int64, Int64})
12101210
precompile(Tuple{typeof(Base.rehash!), Base.Dict{AbstractString, Base.Semaphore}, Int64})
12111211
precompile(Tuple{typeof(Base.resize!), Array{Base.Semaphore, 1}, Int64})
@@ -1322,14 +1322,14 @@ precompile(Tuple{typeof(Base.ndigits0z), UInt8})
13221322
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.Distributed.RemoteValue, Base.Distributed.RRID})
13231323
precompile(Tuple{typeof(Base.dec), UInt8, Int64, Bool})
13241324
precompile(Tuple{typeof(Core.Inference.mk_getfield), TypedSlot, Int64, Type{Integer}})
1325-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.Distributed.RRID})
1325+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.Distributed.RRID})
13261326
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Distributed.RemoteValue, Base.Distributed.RRID, Int64})
13271327
precompile(Tuple{typeof(Core.Inference.length), Tuple{Core.Inference.Const, DataType, Core.Inference.Const}})
13281328
precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, DataType, Core.Inference.Const}, Int64})
13291329
precompile(Tuple{typeof(Base.notify), Base.Condition, Base.Distributed.ProcessExitedException, Bool, Bool})
13301330
precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Void}, Int64})
13311331
precompile(Tuple{typeof(Base.Distributed.process_messages), Base.TCPSocket, Base.TCPSocket, Bool})
1332-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Int64, Void}, Int64})
1332+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Void}, Int64})
13331333
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Void}, Void, Int64, Int64})
13341334
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Void}, Void, Int64})
13351335
precompile(Tuple{typeof(Base.pop!), Base.Dict{Int64, Union{Base.Distributed.Worker, Base.Distributed.LocalProcess}}, Int64, Void})
@@ -1370,7 +1370,7 @@ precompile(Tuple{typeof(Base.Serializer.serialize_cycle), Base.Distributed.Clust
13701370
precompile(Tuple{typeof(Base.Serializer.serialize_type), Base.Distributed.ClusterSerializer{Base.TCPSocket}, DataType})
13711371
precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, UInt64}, Int64})
13721372
precompile(Tuple{typeof(Base.resize!), Array{UInt64, 1}, Int64})
1373-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{UInt64, UInt64}, UInt64})
1373+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, UInt64}, UInt64})
13741374
precompile(Tuple{typeof(Base.Serializer.serialize), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Bool})
13751375
precompile(Tuple{typeof(Base.Distributed.serialize_global_from_main), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Symbol})
13761376
precompile(Tuple{typeof(Base.Serializer.serialize_mod_names), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Module})
@@ -1379,7 +1379,7 @@ precompile(Tuple{typeof(Core.Inference.isbits), Symbol})
13791379
precompile(Tuple{typeof(Base.Serializer.serialize), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Module})
13801380
precompile(Tuple{typeof(Base.isassigned), Array{Symbol, 1}, Int64})
13811381
precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, Void}, Int64})
1382-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{UInt64, Void}, UInt64})
1382+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, Void}, UInt64})
13831383
precompile(Tuple{typeof(Base._setindex!), Base.Dict{UInt64, Void}, Void, UInt64, Int64})
13841384
precompile(Tuple{typeof(Base.Serializer.serialize), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Array{Any, 1}})
13851385
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Any}, TypeName})
@@ -1549,7 +1549,7 @@ precompile(Tuple{typeof(Base.Distributed.remotecall_fetch), typeof(Base.Distribu
15491549
precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##remotecall_fetch")), Array{Any, 1}, typeof(Base.Distributed.remotecall_fetch), typeof(Base.Distributed.put_ref), Base.Distributed.Worker, Base.Distributed.RRID, Base.Distributed.WorkerPool})
15501550
precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##remotecall_fetch")), Array{Any, 1}, typeof(Base.Distributed.remotecall_fetch), typeof(Base.Distributed.put_ref), Base.Distributed.LocalProcess, Base.Distributed.RRID, Base.Distributed.WorkerPool})
15511551
precompile(Tuple{typeof(Base.rehash!), Base.Dict{WeakRef, Void}, Int64})
1552-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{WeakRef, Void}, WeakRef})
1552+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{WeakRef, Void}, WeakRef})
15531553
precompile(Tuple{typeof(Base._setindex!), Base.Dict{WeakRef, Void}, Void, WeakRef, Int64})
15541554
precompile(Tuple{typeof(Base.setindex!), Base.Dict{WeakRef, Void}, Void, WeakRef})
15551555
precompile(Tuple{typeof(Base.finalizer), typeof(Base.Distributed.finalize_ref), Base.Distributed.RemoteChannel{Base.Channel{Any}}})
@@ -1723,9 +1723,9 @@ precompile(Tuple{typeof(Base.getindex), Type{Tuple{String, Float64}}, Tuple{Stri
17231723
precompile(Tuple{typeof(Base.Grisu._show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Float64, Int64, Int64, Bool, Bool})
17241724
precompile(Tuple{typeof(Base.hash), Base.Distributed.Future, UInt64})
17251725
precompile(Tuple{typeof(Base.hash), Tuple{String, Float64}, UInt64})
1726-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Symbol, Base.Condition}, Symbol})
1727-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Symbol, UInt64}, Symbol})
1728-
precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}})
1726+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Symbol, Base.Condition}, Symbol})
1727+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Symbol, UInt64}, Symbol})
1728+
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}})
17291729
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, Base.Condition}, Symbol})
17301730
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, UInt64}, Symbol})
17311731
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}})

test/dict.jl

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ end
9191
end
9292
end
9393

94+
let x = Dict(3=>3, 5=>5, 8=>8, 6=>6)
95+
pop!(x, 5)
96+
for k in keys(x)
97+
Dict{Int,Int}(x)
98+
@test k in [3, 8, 6]
99+
end
100+
end
101+
94102
let z = Dict()
95103
get_KeyError = false
96104
try

0 commit comments

Comments
 (0)