Skip to content

Commit 3bec632

Browse files
visrYingboMa
andauthored
avoid extra dict lookup
Co-authored-by: Yingbo Ma <mayingbo5@gmail.com>
1 parent cbdd5da commit 3bec632

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/systems/connectors.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,8 @@ function expand_instream(csets::AbstractVector{<:ConnectionSet}, sys::AbstractSy
395395
for ex in instream_exprs
396396
ns_sv = only(arguments(ex))
397397
full_name_sv = renamespace(namespace, ns_sv)
398-
if haskey(expr_cset, full_name_sv)
399-
cset = expr_cset[full_name_sv]
400-
else
401-
error("$ns_sv is not a variable inside stream connectors")
402-
end
398+
cset = get(expr_cset, full_name_sv, nothing)
399+
cset === nothing && error("$ns_sv is not a variable inside stream connectors")
403400
idx_in_set, sv = get_cset_sv(full_name_sv, cset)
404401

405402
n_inners = n_outers = 0

0 commit comments

Comments
 (0)