Skip to content

Commit 6e1a946

Browse files
committed
Better definition of storedvalues(::SubArray)
1 parent 1b3c643 commit 6e1a946

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wrappers.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ function eachstoredparentindex(a::SubArray)
1919
end
2020
end
2121
function storedvalues(a::SubArray)
22-
return @view parent(a)[collect(eachstoredparentindex(a))]
22+
# We use `StoredValues` rather than `@view`/`SubArray` so that
23+
# it gets interpreted as a dense array.
24+
return StoredValues(parent(a), collect(eachstoredparentindex(a)))
2325
end
2426
function isstored(a::SubArray, I::Int...)
2527
return isstored(parent(a), Base.reindex(parentindices(a), I)...)

0 commit comments

Comments
 (0)