Skip to content

Commit 32a3500

Browse files
committed
restore isempty test
1 parent e3e6ea3 commit 32a3500

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/b-splines/b-splines.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ function BSplineInterpolation(::Type{TWeights}, A::AbstractArray{Tel,N}, ::IT, :
2525
for _ in 2:N
2626
c *= c
2727
end
28-
T = typeof(c*first(A))
28+
if isempty(A)
29+
T = Base.promote_op(*, typeof(c), eltype(A))
30+
else
31+
T = typeof(c * first(A))
32+
end
2933
BSplineInterpolation{T,N,typeof(A),IT,GT,pad}(A)
3034
end
3135

src/gridded/gridded.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ function GriddedInterpolation(::Type{TWeights}, knots::NTuple{N,GridIndex}, A::A
2828
for _ in 2:N
2929
c *= c
3030
end
31-
T = typeof(c*first(A))
31+
if isempty(A)
32+
T = Base.promote_op(*, typeof(c), eltype(A))
33+
else
34+
T = typeof(c * first(A))
35+
end
3236
GriddedInterpolation{T,N,TCoefs,IT,typeof(knts),pad}(knts, A)
3337
end
3438

0 commit comments

Comments
 (0)