Skip to content

Commit 1190fcd

Browse files
lkdvoskshyatt
authored andcommitted
bypass scalar indexing by specializing
1 parent 06b3033 commit 1190fcd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/factorizations/truncation.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ end
2929
# ---------
3030
_blocklength(d::Integer, ind) = _blocklength(Base.OneTo(d), ind)
3131
_blocklength(ax, ind) = length(ax[ind])
32+
_blocklength(ax::Base.OneTo, ind::AbstractVector{<:Integer}) = length(ind)
33+
3234
function truncate_space(V::ElementarySpace, inds)
3335
return spacetype(V)(c => _blocklength(dim(V, c), ind) for (c, ind) in inds)
3436
end

0 commit comments

Comments
 (0)