Skip to content

Commit

Permalink
remove unbound type parameters (#516)
Browse files Browse the repository at this point in the history
I didn't check, but unbound type parameters often cause performance
issues, so this may not be merely cosmetic.
  • Loading branch information
nsajko authored Sep 8, 2022
1 parent 006a0a5 commit e1f491f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,10 @@ end
@inline checkbounds(::Type{Bool}, itp::AbstractInterpolation, x::Vararg{ExpandedIndexTypes,N}) where N =
_checkbounds(BoundsCheckStyle(itp), itp, x)

@inline checkbounds(::Type{Bool}, itp::AbstractInterpolation, x::LogicalIndex) where N =
@inline checkbounds(::Type{Bool}, itp::AbstractInterpolation, x::LogicalIndex) =
_checkbounds(BoundsCheckStyle(itp), itp, x)

@inline checkbounds(::Type{Bool}, itp::AbstractInterpolation, x::LogicalIndex{<:Any,<:AbstractArray{Bool,1}}) where N =
@inline checkbounds(::Type{Bool}, itp::AbstractInterpolation, x::LogicalIndex{<:Any,<:AbstractArray{Bool,1}}) =
_checkbounds(BoundsCheckStyle(itp), itp, x)

_checkbounds(::CheckWillPass, itp, x) = true
Expand Down
4 changes: 2 additions & 2 deletions src/gridded/gridded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end
Construct a GriddedInterpolation for generic knots from an AbstractArray
"""
function GriddedInterpolation(::Type{TWeights}, knots::NTuple{N,GridIndex}, A::AbstractArray{Tel,N}, it::IT) where {N,Tel,TWeights<:Real,IT<:DimSpec{Gridded},pad}
function GriddedInterpolation(::Type{TWeights}, knots::NTuple{N,GridIndex}, A::AbstractArray{Tel,N}, it::IT) where {N,Tel,TWeights<:Real,IT<:DimSpec{Gridded}}
isconcretetype(IT) || error("The b-spline type must be a leaf type (was $IT)")

check_gridded(it, knots, axes(A))
Expand All @@ -57,7 +57,7 @@ end
AbstractUnitRanges are collected to an Array to not confuse bound calculations (See Issue #398)
"""
function GriddedInterpolation(tw::Type{TWeights}, knots::NTuple{N,AbstractUnitRange}, A::AbstractArray{TCoefs,N}, it::IT) where {N,TCoefs,TWeights<:Real,IT<:DimSpec{Gridded},pad}
function GriddedInterpolation(tw::Type{TWeights}, knots::NTuple{N,AbstractUnitRange}, A::AbstractArray{TCoefs,N}, it::IT) where {N,TCoefs,TWeights<:Real,IT<:DimSpec{Gridded}}
# Fix Issue 398: Ensure that gridded_*bounds is used by converting
# AbstractUnitRange to a non-AbstractUnitRange AbstractVector
GriddedInterpolation(tw, collect.(knots), A, it)
Expand Down

0 comments on commit e1f491f

Please sign in to comment.