Skip to content

Commit

Permalink
Micro-optimization in WeakKeyDict constructor (#49690)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner authored May 9, 2023
1 parent 33a2a9d commit 493a16a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/weakkeydict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mutable struct WeakKeyDict{K,V} <: AbstractDict{K,V}

# Constructors mirror Dict's
function WeakKeyDict{K,V}() where V where K
t = new(Dict{Any,V}(), ReentrantLock(), identity, 0)
t = new(Dict{WeakRef,V}(), ReentrantLock(), identity, 0)
t.finalizer = k -> t.dirty = true
return t
end
Expand Down

0 comments on commit 493a16a

Please sign in to comment.