@@ -1062,15 +1062,15 @@ function compile_user_affect(affect::MutatingFunctionalAffect, cb, sys, dvs, ps;
1062
1062
zeros (sz)
1063
1063
end
1064
1064
obs_fun = build_explicit_observed_function (
1065
- sys, reduce (vcat, Symbolics. scalarize .(obs_exprs); init = [] );
1065
+ sys, Symbolics. scalarize .(obs_exprs);
1066
1066
array_type = :tuple )
1067
1067
obs_sym_tuple = (obs_syms... ,)
1068
1068
1069
1069
# okay so now to generate the stuff to assign it back into the system
1070
1070
mod_pairs = mod_exprs .=> mod_syms
1071
1071
mod_names = (mod_syms... , )
1072
1072
mod_og_val_fun = build_explicit_observed_function (
1073
- sys, reduce (vcat, Symbolics. scalarize .(first .(mod_pairs)); init = [] );
1073
+ sys, Symbolics. scalarize .(first .(mod_pairs));
1074
1074
array_type = :tuple )
1075
1075
1076
1076
upd_funs = NamedTuple {mod_names} ((setu .((sys,), first .(mod_pairs))... ,))
@@ -1084,7 +1084,8 @@ function compile_user_affect(affect::MutatingFunctionalAffect, cb, sys, dvs, ps;
1084
1084
let user_affect = func (affect), ctx = context (affect)
1085
1085
function (integ)
1086
1086
# update the to-be-mutated values; this ensures that if you do a no-op then nothing happens
1087
- upd_component_array = NamedTuple {mod_names} (mod_og_val_fun (integ. u, integ. p... , integ. t))
1087
+ modvals = mod_og_val_fun (integ. u, integ. p... , integ. t)
1088
+ upd_component_array = NamedTuple {mod_names} (modvals)
1088
1089
1089
1090
# update the observed values
1090
1091
obs_component_array = NamedTuple {obs_sym_tuple} (obs_fun (integ. u, integ. p... , integ. t))
0 commit comments