Skip to content

Commit

Permalink
Better definition of storedvalues(::SubArray)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Dec 13, 2024
1 parent 1b3c643 commit 6e1a946
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ function eachstoredparentindex(a::SubArray)
end
end
function storedvalues(a::SubArray)

Check warning on line 21 in src/wrappers.jl

View check run for this annotation

Codecov / codecov/patch

src/wrappers.jl#L21

Added line #L21 was not covered by tests
return @view parent(a)[collect(eachstoredparentindex(a))]
# We use `StoredValues` rather than `@view`/`SubArray` so that
# it gets interpreted as a dense array.
return StoredValues(parent(a), collect(eachstoredparentindex(a)))

Check warning on line 24 in src/wrappers.jl

View check run for this annotation

Codecov / codecov/patch

src/wrappers.jl#L24

Added line #L24 was not covered by tests
end
function isstored(a::SubArray, I::Int...)
return isstored(parent(a), Base.reindex(parentindices(a), I)...)
Expand Down

0 comments on commit 6e1a946

Please sign in to comment.