Skip to content

Commit 2779856

Browse files
committed
Handle hash collision with customized isequal2
1 parent 8957290 commit 2779856

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/types.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,13 @@ end
339339
###
340340

341341
function BasicSymbolic(s::BasicSymbolic)::BasicSymbolic
342-
get!(wvd, hash2(s), s)
342+
h = hash2(s)
343+
t = get!(wvd, h, s)
344+
if t === s || isequal2(t, s)
345+
return t
346+
else
347+
return s
348+
end
343349
end
344350

345351
function Sym{T}(name::Symbol; kw...) where {T}

0 commit comments

Comments
 (0)