Skip to content

Commit 8010c1f

Browse files
authored
Avoid computing inputs if IO is unspecified
it's an expensive computation
1 parent 7bf1d52 commit 8010c1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/systems/systemstructure.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,11 @@ function _structural_simplify!(state::TearingState, io; simplify = false,
630630
if has_io
631631
ModelingToolkit.markio!(state, orig_inputs, io...)
632632
end
633-
state, input_idxs = ModelingToolkit.inputs_to_parameters!(state, io)
633+
if io !== nothing
634+
state, input_idxs = ModelingToolkit.inputs_to_parameters!(state, io)
635+
else
636+
input_idxs = 0:-1 # Empty range
637+
end
634638
sys, mm = ModelingToolkit.alias_elimination!(state; kwargs...)
635639
if check_consistency
636640
ModelingToolkit.check_consistency(state, orig_inputs)

0 commit comments

Comments
 (0)