From 356354fba2158dc84e8acea5814f34eb66fa753b Mon Sep 17 00:00:00 2001 From: Alberto Mercurio Date: Wed, 16 Oct 2024 00:42:53 +0200 Subject: [PATCH] Minor fixes --- src/preset_time.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preset_time.jl b/src/preset_time.jl index 39439538..2c527a82 100644 --- a/src/preset_time.jl +++ b/src/preset_time.jl @@ -28,7 +28,7 @@ function PresetTimeCallback(tstops, user_affect!; throw(ArgumentError("tstops must either be a number or a Vector. Was $tstops")) end - tstops = sort_inplace ? sort!(tstops) : sort(tstops) + tstops = tstops isa Number ? [tstops] : (sort_inplace ? sort!(tstops) : sort(tstops)) condition = let function (u, t, integrator) @@ -57,7 +57,7 @@ function PresetTimeCallback(tstops, user_affect!; else _tstops = tstops end - for tstop in tstops + for tstop in _tstops add_tstop!(integrator, tstop) end if t ∈ tstops