Skip to content

Commit 3425e1e

Browse files
refactor: only substitute with non-empty rules
1 parent 5df4feb commit 3425e1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/systems/connectors.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,10 +895,12 @@ function expand_connections(sys::AbstractSystem; tol = 1e-10)
895895
stream_eqs, instream_subs = expand_instream(instream_csets, sys; tol = tol)
896896

897897
eqs = [equations(sys); ceqs; stream_eqs]
898-
# substitute `instream(..)` expressions with their new values
899-
for i in eachindex(eqs)
900-
eqs[i] = fixpoint_sub(
901-
eqs[i], instream_subs; maxiters = max(length(instream_subs), 10))
898+
if !isempty(instream_subs)
899+
# substitute `instream(..)` expressions with their new values
900+
for i in eachindex(eqs)
901+
eqs[i] = fixpoint_sub(
902+
eqs[i], instream_subs; maxiters = max(length(instream_subs), 10))
903+
end
902904
end
903905
# get the defaults for domain networks
904906
d_defs = domain_defaults(sys, domain_csets)

0 commit comments

Comments
 (0)