Skip to content

Commit c1b95fc

Browse files
committed
replace typeof(...) <: by isa
1 parent 1574722 commit c1b95fc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/solve.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ function init_call(_prob, args...; merge_callbacks = true, kwargshandle = nothin
477477
if _prob isa Union{ODEProblem, DAEProblem} && isnothing(_prob.u0)
478478
build_null_integrator(_prob, args...; kwargs...)
479479
elseif hasfield(typeof(_prob), :f) && hasfield(typeof(_prob.f), :f) &&
480-
typeof(_prob.f.f) <: EvalFunc
480+
_prob.f.f isa EvalFunc
481481
Base.invokelatest(__init, _prob, args...; kwargs...)#::T
482482
else
483483
__init(_prob, args...; kwargs...)#::T
@@ -503,7 +503,7 @@ end
503503
function init_up(prob::AbstractDEProblem, sensealg, u0, p, args...; kwargs...)
504504
alg = extract_alg(args, kwargs, prob.kwargs)
505505
if isnothing(alg) || !(alg isa AbstractDEAlgorithm) # Default algorithm handling
506-
_prob = get_concrete_problem(prob, !(typeof(prob) <: DiscreteProblem); u0 = u0,
506+
_prob = get_concrete_problem(prob, !(prob isa DiscreteProblem); u0 = u0,
507507
p = p, kwargs...)
508508
init_call(_prob, args...; kwargs...)
509509
else
@@ -549,7 +549,7 @@ function solve_call(_prob, args...; merge_callbacks = true, kwargshandle = nothi
549549
end
550550

551551
if hasfield(typeof(_prob), :f) && hasfield(typeof(_prob.f), :f) &&
552-
typeof(_prob.f.f) <: EvalFunc
552+
_prob.f.f isa EvalFunc
553553
Base.invokelatest(__solve, _prob, args...; kwargs...)#::T
554554
else
555555
__solve(_prob, args...; kwargs...)#::T
@@ -991,7 +991,7 @@ function solve_up(prob::Union{AbstractDEProblem, NonlinearProblem}, sensealg, u0
991991
args...; kwargs...)
992992
alg = extract_alg(args, kwargs, prob.kwargs)
993993
if isnothing(alg) || !(alg isa AbstractDEAlgorithm) # Default algorithm handling
994-
_prob = get_concrete_problem(prob, !(typeof(prob) <: DiscreteProblem); u0 = u0,
994+
_prob = get_concrete_problem(prob, !(prob isa DiscreteProblem); u0 = u0,
995995
p = p, kwargs...)
996996
solve_call(_prob, args...; kwargs...)
997997
else
@@ -1271,7 +1271,7 @@ function __solve(prob::AbstractDEProblem, args...; default_set = false, second_t
12711271
kwargs...)
12721272
if second_time
12731273
throw(NoDefaultAlgorithmError())
1274-
elseif length(args) > 0 && !(typeof(first(args)) <: Union{Nothing, AbstractDEAlgorithm})
1274+
elseif length(args) > 0 && !(first(args) isa Union{Nothing, AbstractDEAlgorithm})
12751275
throw(NonSolverError())
12761276
else
12771277
__solve(prob, nothing, args...; default_set = false, second_time = true, kwargs...)
@@ -1282,7 +1282,7 @@ function __init(prob::AbstractDEProblem, args...; default_set = false, second_ti
12821282
kwargs...)
12831283
if second_time
12841284
throw(NoDefaultAlgorithmError())
1285-
elseif length(args) > 0 && !(typeof(first(args)) <: Union{Nothing, AbstractDEAlgorithm})
1285+
elseif length(args) > 0 && !(first(args) isa Union{Nothing, AbstractDEAlgorithm})
12861286
throw(NonSolverError())
12871287
else
12881288
__init(prob, nothing, args...; default_set = false, second_time = true, kwargs...)
@@ -1409,7 +1409,7 @@ function _solve_adjoint(prob, sensealg, u0, p, originator, args...; merge_callba
14091409
kwargs...)
14101410
alg = extract_alg(args, kwargs, prob.kwargs)
14111411
if isnothing(alg) || !(alg isa AbstractDEAlgorithm) # Default algorithm handling
1412-
_prob = get_concrete_problem(prob, !(typeof(prob) <: DiscreteProblem); u0 = u0,
1412+
_prob = get_concrete_problem(prob, !(prob isa DiscreteProblem); u0 = u0,
14131413
p = p, kwargs...)
14141414
else
14151415
_prob = get_concrete_problem(prob, isadaptive(alg); u0 = u0, p = p, kwargs...)
@@ -1439,7 +1439,7 @@ function _solve_forward(prob, sensealg, u0, p, originator, args...; merge_callba
14391439
kwargs...)
14401440
alg = extract_alg(args, kwargs, prob.kwargs)
14411441
if isnothing(alg) || !(alg isa AbstractDEAlgorithm) # Default algorithm handling
1442-
_prob = get_concrete_problem(prob, !(typeof(prob) <: DiscreteProblem); u0 = u0,
1442+
_prob = get_concrete_problem(prob, !(prob isa DiscreteProblem); u0 = u0,
14431443
p = p, kwargs...)
14441444
else
14451445
_prob = get_concrete_problem(prob, isadaptive(alg); u0 = u0, p = p, kwargs...)

0 commit comments

Comments
 (0)