\brief Resolve a logical index to a ChunkLocation. The returned ChunkLocation contains the chunk index and the within-chunk index equivalent to the logical index. \pre `index >= 0` \post `location.chunk_index` in `[0, chunks.size()]` \param index The logical index to resolve \param hint ChunkLocation{} or the last ChunkLocation returned by this ChunkResolver. \return ChunkLocation with a valid c
| 143 | /// bounds, or with `chunk_index == chunks.size()` if logical index is |
| 144 | /// `>= chunked_array.length()`. |
| 145 | inline ChunkLocation ResolveWithHint(int64_t index, ChunkLocation hint) const { |
| 146 | assert(hint.chunk_index < static_cast<uint32_t>(offsets_.size())); |
| 147 | const auto chunk_index = ResolveChunkIndex</*StoreCachedChunk=*/false>( |
| 148 | index, static_cast<int32_t>(hint.chunk_index)); |
| 149 | return ChunkLocation{chunk_index, index - offsets_[chunk_index]}; |
| 150 | } |
| 151 | |
| 152 | /// \brief Resolve `n_indices` logical indices to chunk indices. |
| 153 | /// |