From eae19d2f087208fa7cc7f37608caa2cf8aeaa026 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Thu, 27 Jun 2024 06:45:22 +0000 Subject: [PATCH] refactor: check for extrpolate first --- src/interpolation_methods.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interpolation_methods.jl b/src/interpolation_methods.jl index e00adc59..44bd1561 100644 --- a/src/interpolation_methods.jl +++ b/src/interpolation_methods.jl @@ -1,5 +1,5 @@ function _interpolate(interp, t) - ((t < interp.t[1] || t > interp.t[end]) && !interp.extrapolate) && + (!interp.extrapolate && (t < interp.t[1] || t > interp.t[end])) && throw(ExtrapolationError()) _interpolate(interp, t, firstindex(interp.t) - 1)[1] end