Skip to content

Commit 79c770a

Browse files
committed
Simplify
1 parent 2fda6fd commit 79c770a

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
99
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
1010
DerivableInterfaces = "6c5e35bf-e59e-4898-b73c-732dcc4ba65f"
1111
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
12+
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1213
GradedUnitRanges = "e2de450a-8a67-46c7-b59c-01d5a3d041c5"
1314
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1415
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
@@ -32,6 +33,7 @@ ArrayLayouts = "1.10.4"
3233
BlockArrays = "1.2.0"
3334
DerivableInterfaces = "0.3.7"
3435
Dictionaries = "0.4.3"
36+
FillArrays = "1.13.0"
3537
GPUArraysCore = "0.1.0, 0.2"
3638
GradedUnitRanges = "0.1.0"
3739
LabelledNumbers = "0.1.0"

src/abstractblocksparsearray/wrappedabstractblocksparsearray.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,7 @@ end
361361
Base.show(io::IO, c::UnquotedChar) = print(io, c.char)
362362
Base.show(io::IO, ::MIME"text/plain", c::UnquotedChar) = show(io, c)
363363

364-
# This is copied from `SparseArraysBase.jl` since it is not part
365-
# of the public interface.
366-
function getunstoredindex_show(a::AbstractArray, I::Int...)
367-
return UnquotedChar('')
368-
end
369-
364+
using FillArrays: Fill
370365
struct GetUnstoredBlockShow{Axes}
371366
axes::Axes
372367
end
@@ -378,9 +373,7 @@ end
378373
b_size = ntuple(ndims(a)) do d
379374
return length(f.axes[d][Block(I[d])])
380375
end
381-
b = similar(SparseArrayDOK{eltype(eltype(a))}, b_size)
382-
zero!(b)
383-
return ReplacedUnstoredSparseArray(b, getunstoredindex_show)
376+
return Fill(UnquotedChar('.'), b_size)
384377
end
385378
# TODO: Use `Base.to_indices`.
386379
@inline function (f::GetUnstoredBlockShow)(

0 commit comments

Comments
 (0)