@@ -187,19 +187,23 @@ end
187
187
188
188
function _localindex_newbasket! (ba:: LazyBranch{T,J,B} , idx:: Integer , tid:: Int ) where {T,J,B}
189
189
seek_idx = findfirst (x -> x > (idx - 1 ), ba. fEntry) # support 1.0 syntax
190
- if isnothing (seek_idx) # no basket found, checking in recovered basket
191
- ba. buffer[tid] = basketarray (ba. f, ba. b, - 1 ) # -1 indicating recovered basket mechanics
192
- # FIXME : this range is probably wrong for jagged data with non-empty offsets
193
- br = ba. b. fBasketEntry[end ] + 1 : ba. b. fEntries
194
- else
195
- seek_idx -= 1
196
- ba. buffer[tid] = basketarray (ba. f, ba. b, seek_idx)
197
- br = (ba. fEntry[seek_idx] + 1 ): (ba. fEntry[seek_idx + 1 ])
198
- end
190
+ br = _get_buffer_range (ba, tid, seek_idx)
199
191
ba. buffer_range[tid] = br
200
192
return idx - br. start + 1
201
193
end
202
194
195
+ function _get_buffer_range (ba:: LazyBranch{T, J, B} , tid:: Integer , seek_idx:: Integer ) where {T,J,B}
196
+ seek_idx -= 1
197
+ ba. buffer[tid] = basketarray (ba. f, ba. b, seek_idx)
198
+ (ba. fEntry[seek_idx] + 1 ):: Int : (ba. fEntry[seek_idx + 1 ]):: Int
199
+ end
200
+
201
+ function _get_buffer_range (ba:: LazyBranch{T, J, B} , tid:: Integer , :: Nothing ) where {T,J,B}
202
+ ba. buffer[tid] = basketarray (ba. f, ba. b, - 1 ) # -1 indicating recovered basket mechanics
203
+ # FIXME : this range is probably wrong for jagged data with non-empty offsets
204
+ (ba. b. fBasketEntry[end ] + 1 ):: Int : ba. b. fEntries:: Int
205
+ end
206
+
203
207
Base. IndexStyle (:: Type{<:LazyBranch} ) = IndexLinear ()
204
208
205
209
function Base. iterate (ba:: LazyBranch{T,J,B} , idx= 1 ) where {T,J,B}
0 commit comments