Skip to content

Commit 268a5c3

Browse files
refactor: avoid calling getindex(::TaskLocalValue) twice
Co-authored-by: Aayush Sabharwal <[email protected]>
1 parent af8856b commit 268a5c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/types.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,11 @@ function BasicSymbolic(s::BasicSymbolic)::BasicSymbolic
546546
if !ENABLE_HASHCONSING[]
547547
return s
548548
end
549+
cache = wkd[]
549550
hcw = HashConsingWrapper(s)
550-
k = getkey(wkd[], hcw, nothing)
551+
k = getkey(cache, hcw, nothing)
551552
if isnothing(k)
552-
wkd[][hcw] = nothing
553+
cache[hcw] = nothing
553554
return s
554555
else
555556
return k.bs

0 commit comments

Comments
 (0)