Skip to content

Commit a390882

Browse files
committed
use first instead of [1]
1 parent bbe7e85 commit a390882

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/solve.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ function build_null_integrator(prob::AbstractDEProblem, args...;
573573
typeof(prob.f), typeof(prob.p),
574574
}(Float64[],
575575
Float64[],
576-
first(prob.tspan),
576+
prob.tspan[1],
577577
prob,
578578
sol,
579579
prob.f,
@@ -1015,7 +1015,7 @@ function solve_call(prob::SteadyStateProblem,
10151015
end
10161016

10171017
function solve(prob::EnsembleProblem, args...; kwargs...)
1018-
if isempty(args) || length(args) == 1 && typeof(args[1]) <: EnsembleAlgorithm
1018+
if isempty(args) || length(args) == 1 && typeof(first(args)) <: EnsembleAlgorithm
10191019
__solve(prob, nothing, args...; kwargs...)
10201020
else
10211021
__solve(prob, args...; kwargs...)
@@ -1270,7 +1270,7 @@ function __solve(prob::AbstractDEProblem, args...; default_set = false, second_t
12701270
kwargs...)
12711271
if second_time
12721272
throw(NoDefaultAlgorithmError())
1273-
elseif length(args) > 0 && !(typeof(args[1]) <: Union{Nothing, AbstractDEAlgorithm})
1273+
elseif length(args) > 0 && !(typeof(first(args)) <: Union{Nothing, AbstractDEAlgorithm})
12741274
throw(NonSolverError())
12751275
else
12761276
__solve(prob, nothing, args...; default_set = false, second_time = true, kwargs...)
@@ -1281,7 +1281,7 @@ function __init(prob::AbstractDEProblem, args...; default_set = false, second_ti
12811281
kwargs...)
12821282
if second_time
12831283
throw(NoDefaultAlgorithmError())
1284-
elseif length(args) > 0 && !(typeof(args[1]) <: Union{Nothing, AbstractDEAlgorithm})
1284+
elseif length(args) > 0 && !(typeof(first(args)) <: Union{Nothing, AbstractDEAlgorithm})
12851285
throw(NonSolverError())
12861286
else
12871287
__init(prob, nothing, args...; default_set = false, second_time = true, kwargs...)
@@ -1449,16 +1449,16 @@ function _solve_forward(prob, sensealg, u0, p, originator, args...; merge_callba
14491449
end
14501450

14511451
@inline function extract_alg(solve_args, solve_kwargs, prob_kwargs)
1452-
if isempty(solve_args) || isnothing(solve_args[1])
1452+
if isempty(solve_args) || isnothing(first(solve_args))
14531453
if haskey(solve_kwargs, :alg)
14541454
solve_kwargs[:alg]
14551455
elseif haskey(prob_kwargs, :alg)
14561456
prob_kwargs[:alg]
14571457
else
14581458
nothing
14591459
end
1460-
elseif solve_args[1] isa SciMLBase.AbstractSciMLAlgorithm
1461-
solve_args[1]
1460+
elseif first(solve_args) isa SciMLBase.AbstractSciMLAlgorithm
1461+
first(solve_args)
14621462
else
14631463
nothing
14641464
end

0 commit comments

Comments
 (0)