Skip to content

Commit 81df0ab

Browse files
committed
Turn into an interface function
1 parent 109a507 commit 81df0ab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/abstractsparsearrayinterface.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ end
5454
return error("Not implemented.")
5555
end
5656

57+
@interface ::AbstractArrayInterface function isstored(a::SubArray, I::Int...)
58+
return isstored(parent(a), Base.reindex(parentindices(a), I)...)
59+
end
60+
5761
# TODO: Use `Base.to_indices`?
5862
isstored(a::AbstractArray, I::CartesianIndex) = isstored(a, Tuple(I)...)
5963
# TODO: Use `Base.to_indices`?
@@ -102,8 +106,8 @@ end
102106
SparseArraysBase.storedvalues(::T)
103107
end
104108

105-
function isstored(a::SubArray, I::Int...)
106-
return isstored(parent(a), Base.reindex(parentindices(a), I)...)
109+
@derive (T=SubArray,) begin
110+
SparseArraysBase.isstored(::T, ::Int...)
107111
end
108112

109113
# TODO: Add `ndims` type parameter, like `Base.Broadcast.AbstractArrayStyle`.

0 commit comments

Comments
 (0)