Pre-condition: physical_pos < RunEndsArray(array_span_).length);
| 415 | |
| 416 | // Pre-condition: physical_pos < RunEndsArray(array_span_).length); |
| 417 | inline int64_t run_end(int64_t physical_pos) const { |
| 418 | assert(physical_pos < RunEndsArray(array_span_).length); |
| 419 | // Logical index of the end of the run at physical_pos with offset applied |
| 420 | const int64_t logical_run_end = |
| 421 | std::max<int64_t>(static_cast<int64_t>(run_ends_[physical_pos]) - offset(), 0); |
| 422 | // The current run may go further than the logical length, cap it |
| 423 | return std::min(logical_run_end, length()); |
| 424 | } |
| 425 | |
| 426 | private: |
| 427 | const ArraySpan& array_span_; |