Skip to content

Commit b9d573d

Browse files
committed
revert loop
1 parent 19c976c commit b9d573d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/reactionsystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,12 +764,14 @@ function make_ReactionSystem_internal(rxs_and_eqs::Vector, iv, us_in, ps_in; spa
764764
eqs = Equation[eq for eq in rxs_and_eqs if eq isa Equation]
765765

766766
# Loops through all reactions, adding encountered quantities to the unknown and parameter vectors.
767+
# Starts by looping through substrates + products only (so these are added to the vector first).
768+
# Next, the otehr components of reactions (e.g. rates and stoichiometries) are added.
767769
for rx in rxs
768-
# Loops through all reaction substrates and products, extracting these.
769770
for reactants in (rx.substrates, rx.products), spec in reactants
770771
MT.isparameter(spec) ? push!(ps, spec) : push!(us, spec)
771772
end
772-
773+
end
774+
for rx in rxs
773775
# Adds all quantitites encountered in the reaction's rate.
774776
findvars!(ps, us, rx.rate, ivs, vars)
775777

0 commit comments

Comments
 (0)