Skip to content

Commit 3570351

Browse files
committed
Fix setindex! for VectorOfArrays
1 parent e04092f commit 3570351

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vector_of_arrays.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ end
251251

252252

253253
Base.@propagate_inbounds function Base.setindex!(A::VectorOfArrays{T,N}, x::AbstractArray{U,N}, i::Integer) where {T,N,U}
254-
r, s = _view_reshape_spec(A, i)
255-
@boundscheck s == size(x) || throw(DimensionMismatch("Can't assign array to element $i of VectorOfArrays, array size is incompatible"))
256-
A.data[rng] = x
257-
A
254+
a = A[i]
255+
# @boundscheck size(a) == size(x) || throw(DimensionMismatch("Can't assign array to element $i of VectorOfArrays, array size is incompatible"))
256+
a[:] = x
257+
return A
258258
end
259259

260260
Base.length(A::VectorOfArrays) = length(A.kernel_size)

0 commit comments

Comments
 (0)