| 169 | } |
| 170 | |
| 171 | void Advance(size_t n) { |
| 172 | ABSL_ASSERT(n <= Remaining()); |
| 173 | if (n == 0) { |
| 174 | return; |
| 175 | } |
| 176 | if (index_ < buffer_.size()) { |
| 177 | size_t count = std::min(n, buffer_.size() - index_); |
| 178 | index_ += count; |
| 179 | n -= count; |
| 180 | size_ -= count; |
| 181 | if (index_ < buffer_.size()) { |
| 182 | return; |
| 183 | } |
| 184 | // Temporary buffer is empty, clear it. |
| 185 | buffer_.clear(); |
| 186 | index_ = 0; |
| 187 | } |
| 188 | input_.RemovePrefix(n); |
| 189 | size_ -= n; |
| 190 | } |
| 191 | |
| 192 | void Reset(const absl::Cord& input) { |
| 193 | input_ = input; |
no test coverage detected