Skip to content

Commit

Permalink
Update src/chainedvector.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Jerry Ling <[email protected]>
  • Loading branch information
quinnj and Moelf authored Oct 24, 2024
1 parent 74e984d commit 97b6005
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/chainedvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ end
Base.@propagate_inbounds function Base.getindex(x::ChainedVector{T, A}, inds::UnitRange{Int}) where {T, A}
isempty(inds) && return similar(x, 0)
len = length(inds)
res = similar(x.arrays[1], len)
chunk = j = ind = 1
chunklen = length(x.arrays[1])
arrays = x.arrays
res = similar(arrays[1], len)
chunk = j = ind = 1
chunklen = length(arrays[1])

# linearindex first item
chunk, chunklen, j = linearindex(x, chunk, chunklen, j, ind, inds[1])
@inbounds arraychunk = arrays[chunk]
Expand Down

0 comments on commit 97b6005

Please sign in to comment.