Skip to content

Commit d883892

Browse files
authored
use method.degree instead of constructing a new one (#132)
1 parent c66b77a commit d883892

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/compat.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,3 @@ end
2323
@inline _nan(::Type{HSV{Float32}}) = HSV{Float32}(NaN32,NaN32,NaN32)
2424
@inline _nan(::Type{HSV{Float64}}) = HSV{Float64}(NaN,NaN,NaN)
2525
@inline _nan(::Type{T}) where {T} = nan(T)
26-
27-
if !hasmethod(Constant{Nearest}, ())
28-
# `Constant{Nearest}()` is not defined for Interpolations <= v0.13.2
29-
# https://github.com/JuliaMath/Interpolations.jl/pull/426
30-
construct_interpolation_type(::Type{T}) where T<:Union{Linear, Constant} = T()
31-
construct_interpolation_type(::Type{Constant{Nearest}}) = Constant()
32-
else
33-
construct_interpolation_type(::Type{T}) where T<:Union{Linear, Constant} = T()
34-
end

src/interpolations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ box_extrapolation(itp::AbstractInterpolation{T}; fillvalue=_default_fillvalue(T)
3535
return Interpolations.BSplineInterpolation{T,ndims(A),typeof(A),BSpline{D},typeof(axs)}(A, axs, BSpline(degree))
3636
end
3737
@inline function maybe_skip_prefilter(::Type{T}, A::AbstractArray, method::BSpline{D}) where {T, D<:Union{Linear, Constant}}
38-
maybe_skip_prefilter(T, A, construct_interpolation_type(D))
38+
maybe_skip_prefilter(T, A, method.degree)
3939
end
4040

4141
@inline function maybe_skip_prefilter(::Type{T}, A::AbstractArray, method::MethodType) where T

0 commit comments

Comments
 (0)