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)
88
88
end
89
89
end
90
90
91
- const wvd = TaskLocalValue {WeakValueDict{UInt, BasicSymbolic}} (WeakValueDict{UInt, BasicSymbolic})
91
+ const wcs = TaskLocalValue {WeakCacheSet{ BasicSymbolic}} (WeakCacheSet{ BasicSymbolic})
92
92
93
93
# Same but different error messages
94
94
@noinline error_on_type () = error (" Internal error: unreachable reached!" )
@@ -547,20 +547,12 @@ function BasicSymbolic(s::BasicSymbolic)::BasicSymbolic
547
547
if ! ENABLE_HASHCONSING[]
548
548
return s
549
549
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
563
554
end
555
+ return k
564
556
end
565
557
566
558
function Sym {T} (name:: Symbol ; kw... ) where {T}
You can’t perform that action at this time.
0 commit comments