File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
name = " BlockArrays"
2
2
uuid = " 8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3
- version = " 0.16.4 "
3
+ version = " 0.16.5 "
4
4
5
5
[deps ]
6
6
ArrayLayouts = " 4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ _blocklengths2blocklasts(blocks) = cumsum(blocks) # extra level to allow changin
60
60
61
61
_diff (a:: AbstractVector ) = diff (a)
62
62
_diff (a:: Tuple ) = diff (collect (a))
63
- @inline blocklengths (a:: BlockedUnitRange ) = [first (a. lasts)- a. first+ 1 ; _diff (a. lasts)]
63
+ @inline blocklengths (a:: BlockedUnitRange ) = isempty (a . lasts) ? _diff (a . lasts) : [first (a. lasts)- a. first+ 1 ; _diff (a. lasts)]
64
64
65
65
length (a:: BlockedUnitRange ) = isempty (a. lasts) ? 0 : Integer (last (a. lasts)- a. first+ 1 )
66
66
Original file line number Diff line number Diff line change 555
555
@test (a' )[:,Block .(1 : 2 )] isa Adjoint
556
556
@test transpose (a)[:,Block .(1 : 2 )] isa Transpose
557
557
end
558
+
559
+ @testset " empty blocklengths" begin
560
+ A = BlockVector {Float64} (undef,Int[])
561
+ @test @inferred (isempty (blocklengths (axes (A,1 ))))
562
+ end
558
563
end
You can’t perform that action at this time.
0 commit comments