MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Advance

Method Advance

internal/utf8.cc:171–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 3

Utf8IsValidImplFunction · 0.45
Utf8CodePointCountImplFunction · 0.45
Utf8ValidateImplFunction · 0.45

Calls 3

clearMethod · 0.80
RemovePrefixMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected