Skip to content

Commit 3402cb5

Browse files
committed
ismutable as generated function
1 parent bb33f39 commit 3402cb5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/array_partition.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ end
7171
Base.ones(A::ArrayPartition, dims::NTuple{N,Int}) where {N} = ones(A)
7272

7373
# mutable iff all components of ArrayPartition are mutable
74-
function ArrayInterface.ismutable(::Type{<:ArrayPartition{T,S}}) where {T,S}
75-
all(ArrayInterface.ismutable, S.parameters)
74+
@generated function ArrayInterface.ismutable(::Type{<:ArrayPartition{T,S}}) where {T,S}
75+
res = all(ArrayInterface.ismutable, S.parameters)
76+
return :( $res )
7677
end
7778

7879
## vector space operations

0 commit comments

Comments
 (0)