@@ -238,7 +238,8 @@ offset_if_vec(i::Integer, axs::Tuple) = i
238238
239239@inline function isassigned (A:: ReshapedArrayLF , index:: Int )
240240 @boundscheck checkbounds (Bool, A, index) || return false
241- @inbounds ret = isassigned (parent (A), index)
241+ indexparent = index - firstindex (A) + firstindex (parent (A))
242+ @inbounds ret = isassigned (parent (A), indexparent)
242243 ret
243244end
244245@inline function isassigned (A:: ReshapedArray{T,N} , indices:: Vararg{Int, N} ) where {T,N}
251252
252253@inline function getindex (A:: ReshapedArrayLF , index:: Int )
253254 @boundscheck checkbounds (A, index)
254- @inbounds ret = parent (A)[index]
255+ indexparent = index - firstindex (A) + firstindex (parent (A))
256+ @inbounds ret = parent (A)[indexparent]
255257 ret
256258end
257259@inline function getindex (A:: ReshapedArray{T,N} , indices:: Vararg{Int,N} ) where {T,N}
275277
276278@inline function setindex! (A:: ReshapedArrayLF , val, index:: Int )
277279 @boundscheck checkbounds (A, index)
278- @inbounds parent (A)[index] = val
280+ indexparent = index - firstindex (A) + firstindex (parent (A))
281+ @inbounds parent (A)[indexparent] = val
279282 val
280283end
281284@inline function setindex! (A:: ReshapedArray{T,N} , val, indices:: Vararg{Int,N} ) where {T,N}
0 commit comments