Skip to content

Commit 3877411

Browse files
committed
Update lazyconcat.jl
1 parent 08abedb commit 3877411

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lazyconcat.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Base.IndexStyle(::Type{<:Vcat{T,1}}) where T = Base.IndexLinear()
3131
Base.IndexStyle(::Type{<:Vcat{T,2}}) where T = Base.IndexCartesian()
3232

3333

34-
@propagate_inbounds @inline function getindex(f::Vcat{T,1}, k::Integer) where T
34+
@propagate_inbounds @inline function vcat_getindex(f, k::Integer)
35+
T = eltype(f)
3536
κ = k
3637
for A in f.args
3738
n = length(A)
@@ -41,7 +42,8 @@ Base.IndexStyle(::Type{<:Vcat{T,2}}) where T = Base.IndexCartesian()
4142
throw(BoundsError(f, k))
4243
end
4344

44-
@propagate_inbounds @inline function getindex(f::Vcat{T,2}, k::Integer, j::Integer) where T
45+
@propagate_inbounds @inline function vcat_getindex(f, k::Integer, j::Integer)
46+
T = eltype(f)
4547
κ = k
4648
for A in f.args
4749
n = size(A,1)
@@ -51,6 +53,11 @@ end
5153
throw(BoundsError(f, (k,j)))
5254
end
5355

56+
@propagate_inbounds @inline getindex(f::Vcat{<:Any,1}, k::Integer) = vcat_getindex(f, k)
57+
@propagate_inbounds @inline getindex(f::Vcat{<:Any,2}, k::Integer, j::Integer) = vcat_getindex(f, k, j)
58+
getindex(f::Applied{DefaultArrayApplyStyle,typeof(vcat)}, k::Integer)= vcat_getindex(f, k)
59+
getindex(f::Applied{DefaultArrayApplyStyle,typeof(vcat)}, k::Integer, j::Integer)= vcat_getindex(f, k, j)
60+
5461
@propagate_inbounds @inline function setindex!(f::Vcat{T,1}, v, k::Integer) where T
5562
κ = k
5663
for A in f.args

0 commit comments

Comments
 (0)