Skip to content

Commit a6efc60

Browse files
committed
Stricter blocksparse constructor
1 parent da70733 commit a6efc60

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/blocksparsearray/blocksparsearray.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,7 @@ function blocksparsezeros(::BlockType{A}, axes...) where {A<:AbstractArray}
262262
# to make a bit more generic.
263263
return BlockSparseArray{eltype(A),ndims(A),A}(undef, axes...)
264264
end
265-
function blocksparse(d::Dict, ax::Tuple)
266-
d_narrow = if isempty(d)
267-
Dict{Block{length(ax),Int},AbstractArray{Any,length(ax)}}()
268-
else
269-
Dict(Pair(kv) for kv in d)
270-
end
271-
return blocksparse(d_narrow, ax)
272-
end
273-
function blocksparse(d::Dict{<:Block{N},<:AbstractArray{<:Any,N}}, ax::Tuple) where {N}
265+
function blocksparse(d::Dict{<:Block,<:AbstractArray}, ax::Tuple)
274266
a = blocksparsezeros(BlockType(valtype(d)), ax...)
275267
for I in eachindex(d)
276268
a[I] = d[I]

0 commit comments

Comments
 (0)