| 95 | /// \pre num_offsets - 1 <= std::numeric_limits<IndexType>::max() |
| 96 | template <typename IndexType> |
| 97 | void ResolveManyInline(uint32_t num_offsets, const int64_t* signed_offsets, |
| 98 | int64_t n_indices, const IndexType* logical_index_vec, |
| 99 | TypedChunkLocation<IndexType>* out_chunk_location_vec, |
| 100 | int32_t chunk_hint) { |
| 101 | auto* offsets = reinterpret_cast<const uint64_t*>(signed_offsets); |
| 102 | const auto num_chunks = static_cast<int32_t>(num_offsets - 1); |
| 103 | // chunk_hint in [0, num_offsets) per the precondition. |
| 104 | for (int64_t i = 0; i < n_indices; i++) { |
| 105 | const auto typed_logical_index = logical_index_vec[i]; |
| 106 | const auto loc = ResolveOneInline(num_offsets, offsets, typed_logical_index, |
| 107 | num_chunks, chunk_hint); |
| 108 | out_chunk_location_vec[i] = loc; |
| 109 | chunk_hint = static_cast<int32_t>(loc.chunk_index); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | } // namespace |
| 114 |
no test coverage detected