We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bc5d23 commit e69ef19Copy full SHA for e69ef19
src/systems/callbacks.jl
@@ -922,18 +922,11 @@ function generate_vector_rootfinding_callback(
922
(cb, fn) -> begin
923
if (save_idxs = get(ic.callback_to_clocks, cb, nothing)) !== nothing
924
let save_idxs = save_idxs
925
- if !isnothing(fn.initialize)
926
- (i) -> begin
927
- fn.initialize(i)
928
- for idx in save_idxs
929
- SciMLBase.save_discretes!(i, idx)
930
- end
931
932
- else
933
934
935
936
+ custom_init = fn.initialize
+ (i) -> begin
+ isnothing(custom_init) && custom_init(i)
+ for idx in save_idxs
+ SciMLBase.save_discretes!(i, idx)
937
end
938
939
0 commit comments