Skip to content

Commit 41cdc3c

Browse files
committed
Return tuple in _permfirst
1 parent adf63f4 commit 41cdc3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/chebyshevtransform.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,14 @@ function plan_chebyshevutransform(x::AbstractArray{T,N}, ::Val{2}, dims...; kws.
373373
end
374374

375375

376-
_permfirst(d, N) = [d; 1:d-1; d+1:N]
376+
@inline _permfirst(d, N) = ntuple(i -> i == 1 ? d : i <= d ? i-1 : i, N)
377377

378378
for f in [:_chebu1_prescale!, :_chebu1_postscale!, :_chebu2_prescale!, :_chebu2_postscale!,
379379
:_ichebu1_postscale!]
380380
_f = Symbol(:_, f)
381381
@eval begin
382382
@inline function $f(d::Number, X::AbstractArray)
383+
d 1:ndims(X) || throw("dimension $d must lie between 1 and $(ndims(X))")
383384
Rpre = CartesianIndices(axes(X)[1:d-1])
384385
Rpost = CartesianIndices(axes(X)[d+1:end])
385386
$_f(d, X, Rpre, Rpost)

0 commit comments

Comments
 (0)