Pre-condition: physical_pos < RunEndsArray(array_span_).length);
| 425 | |
| 426 | // Pre-condition: physical_pos < RunEndsArray(array_span_).length); |
| 427 | inline int64_t run_end(int64_t physical_pos) const { |
| 428 | assert(physical_pos < RunEndsArray(array_span_).length); |
| 429 | // Logical index of the end of the run at physical_pos with offset applied |
| 430 | const int64_t logical_run_end = |
| 431 | std::max<int64_t>(static_cast<int64_t>(run_ends_[physical_pos]) - offset(), 0); |
| 432 | // The current run may go further than the logical length, cap it |
| 433 | return std::min(logical_run_end, length()); |
| 434 | } |
| 435 | |
| 436 | private: |
| 437 | const ArraySpan& array_span_; |