@@ -238,7 +238,8 @@ offset_if_vec(i::Integer, axs::Tuple) = i
238
238
239
239
@inline function isassigned (A:: ReshapedArrayLF , index:: Int )
240
240
@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)
242
243
ret
243
244
end
244
245
@inline function isassigned (A:: ReshapedArray{T,N} , indices:: Vararg{Int, N} ) where {T,N}
251
252
252
253
@inline function getindex (A:: ReshapedArrayLF , index:: Int )
253
254
@boundscheck checkbounds (A, index)
254
- @inbounds ret = parent (A)[index]
255
+ indexparent = index - firstindex (A) + firstindex (parent (A))
256
+ @inbounds ret = parent (A)[indexparent]
255
257
ret
256
258
end
257
259
@inline function getindex (A:: ReshapedArray{T,N} , indices:: Vararg{Int,N} ) where {T,N}
275
277
276
278
@inline function setindex! (A:: ReshapedArrayLF , val, index:: Int )
277
279
@boundscheck checkbounds (A, index)
278
- @inbounds parent (A)[index] = val
280
+ indexparent = index - firstindex (A) + firstindex (parent (A))
281
+ @inbounds parent (A)[indexparent] = val
279
282
val
280
283
end
281
284
@inline function setindex! (A:: ReshapedArray{T,N} , val, indices:: Vararg{Int,N} ) where {T,N}
0 commit comments