Skip to content

Commit c7dd384

Browse files
prbzrgChrisRackauckas
authored andcommitted
cleaning
1 parent 7fcf0d7 commit c7dd384

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/solve.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -504,28 +504,28 @@ function init_up(prob::DEProblem, sensealg, u0, p, args...; kwargs...)
504504
_alg = prepare_alg(alg, _prob.u0, _prob.p, _prob)
505505
check_prob_alg_pairing(_prob, alg) # alg for improved inference
506506

507-
if length(args) === 1 && args[1] === nothing
507+
if length(args) <= 1
508508
init_call(_prob, _alg; kwargs...)
509509
else
510-
init_call(_prob, _alg, args[2:end]...; kwargs...)
510+
init_call(_prob, _alg, Base.tail(args)...; kwargs...)
511511
end
512512
elseif haskey(prob.kwargs, :alg) && (isempty(args) || args[1] === nothing)
513513
alg = prob.kwargs[:alg]
514514
_prob = get_concrete_problem(prob, isadaptive(alg); kwargs...)
515515
_alg = prepare_alg(alg, _prob.u0, _prob.p, _prob)
516516
check_prob_alg_pairing(_prob, alg) # alg for improved inference
517-
if length(args) === 1 && args[1] === nothing
517+
if length(args) <= 1
518518
init_call(_prob, _alg; kwargs...)
519519
else
520-
init_call(_prob, _alg, args[2:end]...; kwargs...)
520+
init_call(_prob, _alg, Base.tail(args)...; kwargs...)
521521
end
522522
elseif !isempty(args) && typeof(args[1]) <: DEAlgorithm
523523
alg = args[1]
524524
_prob = get_concrete_problem(prob, isadaptive(alg); kwargs...)
525525
check_prob_alg_pairing(_prob, alg)
526526
_alg = prepare_alg(alg, _prob.u0, _prob.p, _prob)
527-
init_call(_prob, _alg, args[2:end]...; kwargs...)
528-
else
527+
init_call(_prob, _alg, Base.tail(args)...; kwargs...)
528+
else # Default algorithm handling
529529
_prob = get_concrete_problem(prob, !(typeof(prob) <: DiscreteProblem); kwargs...)
530530
init_call(_prob, args...; kwargs...)
531531
end
@@ -1006,20 +1006,20 @@ function solve_up(prob::Union{DEProblem, NonlinearProblem}, sensealg, u0, p, arg
10061006
_prob = get_concrete_problem(prob, isadaptive(alg); u0 = u0, p = p, kwargs...)
10071007
_alg = prepare_alg(alg, _prob.u0, _prob.p, _prob)
10081008
check_prob_alg_pairing(_prob, alg) # use alg for improved inference
1009-
if length(args) === 1 && args[1] === nothing
1009+
if length(args) <= 1
10101010
solve_call(_prob, _alg; kwargs...)
10111011
else
1012-
solve_call(_prob, _alg, args[2:end]...; kwargs...)
1012+
solve_call(_prob, _alg, Base.tail(args)...; kwargs...)
10131013
end
10141014
elseif haskey(prob.kwargs, :alg) && (isempty(args) || args[1] === nothing)
10151015
alg = prob.kwargs[:alg]
10161016
_prob = get_concrete_problem(prob, isadaptive(alg); u0 = u0, p = p, kwargs...)
10171017
_alg = prepare_alg(alg, _prob.u0, _prob.p, _prob)
10181018
check_prob_alg_pairing(_prob, alg) # use alg for improved inference
1019-
if length(args) === 1 && args[1] === nothing
1019+
if length(args) <= 1
10201020
solve_call(_prob, _alg; kwargs...)
10211021
else
1022-
solve_call(_prob, _alg, args[2:end]...; kwargs...)
1022+
solve_call(_prob, _alg, Base.tail(args)...; kwargs...)
10231023
end
10241024
elseif !isempty(args) && typeof(args[1]) <: DEAlgorithm
10251025
alg = args[1]

0 commit comments

Comments
 (0)