Skip to content

Commit f9df541

Browse files
committed
fix empty(::LittleDict)
The old version just called `LittleDict{K, V}()`, but that may not be an accurate empty version of the type passed. This now calls empty on the keys and values seperately.
1 parent 1b63bc8 commit f9df541

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/little_dict.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ function merge(
183183
end
184184

185185

186-
Base.empty(dd::LittleDict{K,V}) where {K,V} = LittleDict{K,V}()
186+
function Base.empty(dd::LittleDict{K,V}) where {K,V}
187+
LittleDict{K, V}(empty(getfield(dd, :keys)), empty(getfield(dd, :vals)))
188+
end
187189

188190
######## Methods that all mutable AbstractDict's should implement
189191

0 commit comments

Comments
 (0)