Skip to content

Commit 71682dc

Browse files
committed
Simplify by fixing collect
1 parent bb6eee3 commit 71682dc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/bimodulesector.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,9 @@ end
376376

377377
function TensorKit.scalar(t::AbstractTensorMap{T,S,0,0}) where {T,
378378
S<:GradedSpace{<:BimoduleSector}}
379-
inds = findall(!iszero last, blocks(t))
379+
Bs = collect(blocks(t))
380+
inds = findall(!iszero last, Bs)
380381
isempty(inds) && return zero(scalartype(t))
381-
@assert length(inds) == 1
382-
383-
c = blocksectors(t)[only(inds)]
384-
return only(block(t, c))
382+
return only(last(Bs[only(inds)]))
385383
end
386384

0 commit comments

Comments
 (0)