Skip to content

Commit

Permalink
split off the empty reduce branch
Browse files Browse the repository at this point in the history
  • Loading branch information
MasonProtter committed Aug 14, 2024
1 parent 6362060 commit 477a8c2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1345,13 +1345,16 @@ function parameter_dependencies(sys::AbstractSystem)
pdeps = get_parameter_dependencies(sys)
systems = get_systems(sys)
# put pdeps after those of subsystems to maintain topological sorted order
return vcat(
reduce(vcat,
Equation[map(eq -> namespace_equation(eq, s), parameter_dependencies(s))
for s in systems];
init = Equation[]),
pdeps
)
if isempty(systems)
return pdeps
else
return vcat(
reduce(vcat,
[map(eq -> namespace_equation(eq, s), parameter_dependencies(s))
for s in systems]),
pdeps
)
end
end

function full_parameters(sys::AbstractSystem)
Expand Down

0 comments on commit 477a8c2

Please sign in to comment.