Skip to content

Commit 098f4e9

Browse files
committed
bugfix
1 parent cde0824 commit 098f4e9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

base/subarray.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ end
339339
function getindex(V::FastContiguousSubArray{<:Any, 1}, i::AbstractUnitRange{Int})
340340
@inline
341341
@boundscheck checkbounds(V, i)
342-
v = @view V.parent[V.offset1 .+ UnitRange(i)]
343342
out = similar(V, axes(i))
344343
li = length(i)
345344
if li > 0

test/subarray.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ end
536536
c1 = a12[ind1]
537537
@test (c1[axes(c1,1)] = a12[ind1]; c1) == (c1[:] = a12[ind1]; c1) == a12[ind1]
538538

539+
inds1 = Base.IdentityUnitRange(Base.OneTo(4))
540+
c1 = @view a1[inds1]
541+
@test (c1[eachindex(c1)] = @view(a12[inds1]); c1) == @view(a12[inds1])
542+
539543
ind2 = 2:2:8
540544
d1 = a12[ind2]
541545
@test (d1[axes(d1,1)] = a12[ind2]; d1) == (d1[:] = a12[ind2]; d1) == a12[ind2]

0 commit comments

Comments
 (0)