| 727 | template <typename T> |
| 728 | template <typename OutType> |
| 729 | inline int32_t RleBatchDecoder<T>::DecodeBufferedLiterals(int32_t max_to_output, |
| 730 | OutType* dict, int64_t dict_len, StrideWriter<OutType>* RESTRICT out) { |
| 731 | int32_t num_to_output = |
| 732 | std::min<int32_t>(max_to_output, num_buffered_literals_ - literal_buffer_pos_); |
| 733 | for (int32_t i = 0; i < num_to_output; ++i) { |
| 734 | T idx = literal_buffer_[literal_buffer_pos_ + i]; |
| 735 | if (UNLIKELY(idx < 0 || idx >= dict_len)) return 0; |
| 736 | out->SetNext(dict[idx]); |
| 737 | } |
| 738 | literal_buffer_pos_ += num_to_output; |
| 739 | literal_count_ -= num_to_output; |
| 740 | return num_to_output; |
| 741 | } |
| 742 | |
| 743 | template <typename T> |
| 744 | inline int32_t RleBatchDecoder<T>::GetValues(int32_t num_values_to_consume, T* values) { |