Skip to content

Commit 92f88e8

Browse files
committed
Simplify
1 parent 006cae4 commit 92f88e8

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
3-
version = "0.10.34"
3+
version = "0.10.35"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[workspace]

src/abstractblocksparsearray/arraylayouts.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ function ArrayLayouts.sub_materialize(layout::BlockLayout{<:SparseLayout}, a, ax
6767
end
6868

6969
function _similar(arraytype::Type{<:AbstractArray{T, N}}, size::Tuple) where {T, N}
70-
if isconcretetype(arraytype)
71-
try
72-
return similar(arraytype, size)
73-
catch err
74-
if !(err isa MethodError)
75-
rethrow()
76-
end
77-
end
78-
end
79-
return similar(Array{T, N}, size)
70+
return isconcretetype(arraytype) ? similar(arraytype, size) : similar(Array{T, N}, size)
8071
end
8172
function _similar(
8273
::Type{<:SubArray{<:Any, <:Any, <:ArrayType}}, size::Tuple

0 commit comments

Comments
 (0)