Skip to content

Commit c3b209d

Browse files
committed
simplify targetstore creation
1 parent a18c744 commit c3b209d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/codeedges.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,7 @@ function direct_links!(cl::CodeLinks, src::CodeInfo)
255255
cl.nameassigns[name] = assign = Int[]
256256
end
257257
push!(assign, i)
258-
targetstore = get(cl.namepreds, name, nothing)
259-
if targetstore === nothing
260-
cl.namepreds[name] = targetstore = Links()
261-
end
258+
targetstore = get!(Links, cl.namepreds, name)
262259
target = P(name, targetstore)
263260
add_links!(target, stmt, cl)
264261
elseif name in (nothing, false)
@@ -281,10 +278,7 @@ function direct_links!(cl::CodeLinks, src::CodeInfo)
281278
if isa(lhs, Symbol)
282279
lhs = GlobalRef(cl.thismod, lhs)
283280
end
284-
targetstore = get(cl.namepreds, lhs, nothing)
285-
if targetstore === nothing
286-
cl.namepreds[lhs] = targetstore = Links()
287-
end
281+
targetstore = get!(Links, cl.namepreds, lhs)
288282
target = P(lhs, targetstore)
289283
assign = get(cl.nameassigns, lhs, nothing)
290284
if assign === nothing

0 commit comments

Comments
 (0)