Skip to content

Commit 010559a

Browse files
authored
The other get! in DoubleDict (#1822)
* The other get in DoubleDict - followup from 1821 * fix space
1 parent f2eb661 commit 010559a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Utilities/DoubleDicts.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ A type stable inner dictionary of [`DoubleDict`](@ref).
5858
mutable struct DoubleDictInner{F,S,V} <: AbstractDoubleDictInner{F,S,V}
5959
dict::Dict{Int64,V}
6060
function DoubleDictInner{F,S}(d::DoubleDict{V}) where {F,S,V}
61-
return new{F,S,V}(get!(d.dict, (F, S), Dict{Int64,V}()))
61+
if !haskey(d.dict, (F, S))
62+
d.dict[(F, S)] = Dict{Int64,V}()
63+
end
64+
return new{F,S,V}(d.dict[(F, S)])
6265
end
6366
end
6467

0 commit comments

Comments
 (0)