File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ function exprtype(x::BasicSymbolic)
8888 end
8989end
9090
91- const wvd = TaskLocalValue {WeakValueDict{UInt, BasicSymbolic}} (WeakValueDict{UInt, BasicSymbolic})
91+ const wcs = TaskLocalValue {WeakCacheSet{ BasicSymbolic}} (WeakCacheSet{ BasicSymbolic})
9292
9393# Same but different error messages
9494@noinline error_on_type () = error (" Internal error: unreachable reached!" )
@@ -547,20 +547,12 @@ function BasicSymbolic(s::BasicSymbolic)::BasicSymbolic
547547 if ! ENABLE_HASHCONSING[]
548548 return s
549549 end
550- cache = wvd[]
551- h = hash2 (s)
552- k = get! (cache, h, s)
553- if isequal_with_metadata (k, s)
554- if iszero (k. id[])
555- k. id[] = @atomic ID_COUNTER. x += 1
556- end
557- return k
558- else
559- if iszero (s. id[])
560- s. id[] = @atomic ID_COUNTER. x += 1
561- end
562- return s
550+ cache = wcs[]
551+ k = getkey! (cache, s)
552+ if iszero (k. id[])
553+ k. id[] = @atomic ID_COUNTER. x += 1
563554 end
555+ return k
564556end
565557
566558function Sym {T} (name:: Symbol ; kw... ) where {T}
You can’t perform that action at this time.
0 commit comments