Skip to content

Commit 87a277f

Browse files
fix: avoid accidental mutation in callback handling
This would mutate `affect`, so that if the same callback was `complete`d multiple times, the equations would be appended multiple times.
1 parent 00d56d4 commit 87a277f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/ModelingToolkitBase/src/systems/callbacks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function AffectSystem(
140140
iv = t_nounits
141141
@warn "No independent variable specified. Defaulting to t_nounits."
142142
end
143-
append!(affect, extra_eqs)
143+
affect = [affect; extra_eqs]
144144

145145
discrete_parameters = SymbolicAffect(affect; discrete_parameters).discrete_parameters
146146

0 commit comments

Comments
 (0)