Skip to content

Commit

Permalink
Use Val(N) in ntuple call
Browse files Browse the repository at this point in the history
Co-authored-by: wheeheee <[email protected]>
  • Loading branch information
martinholters and wheeheee authored Feb 23, 2024
1 parent 60357ed commit 68c20b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dspbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ function _conv(u, v, su, sv)
end

function _conv_td(u::AbstractArray{<:Number, N}, v::AbstractArray{<:Number, N}) where {N}
output_indices = CartesianIndices(ntuple(N) do d
output_indices = CartesianIndices(ntuple(Val(N)) do d
r = (firstindex(u,d)+firstindex(v,d)):(lastindex(u,d)+lastindex(v,d))
if axes(u, d) isa Base.OneTo && axes(v, d) isa Base.OneTo
return r
Expand All @@ -686,7 +686,7 @@ function _conv_td(u::AbstractArray{<:Number, N}, v::AbstractArray{<:Number, N})
end)
return [
sum(u[m] * v[n-m]
for m in CartesianIndices(ntuple(N) do d
for m in CartesianIndices(ntuple(Val(N)) do d
max(firstindex(u,d),n[d]-lastindex(v,d)):min(lastindex(u,d), n[d]-firstindex(v,d))
end)
)
Expand Down

0 comments on commit 68c20b4

Please sign in to comment.