Skip to content

Commit 3318615

Browse files
committed
Swap axes in permutedims
1 parent 18c3530 commit 3318615

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/fillalgebra.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ end
2020

2121
permutedims(a::AbstractFillMatrix) = fillsimilar(a, reverse(axes(a)))
2222

23-
function permutedims(B::AbstractFill, perm)
24-
dimsB = size(B)
25-
ndimsB = length(dimsB)
23+
Base.@constprop :aggressive function permutedims(B::AbstractFill, perm)
24+
dimsB = axes(B)
25+
ndimsB = ndims(B)
2626
(ndimsB == length(perm) && isperm(perm)) || throw(ArgumentError("no valid permutation of dimensions"))
27-
dimsP = ntuple(i->dimsB[perm[i]], ndimsB)::typeof(dimsB)
27+
dimsP = ntuple(i->dimsB[perm[i]], ndimsB)
2828
fillsimilar(B, dimsP)
2929
end
3030

0 commit comments

Comments
 (0)