17 writes to _pos
Microsoft.ML.Tokenizers (17)
Utils\ValueStringBuilder.cs (17)
25_pos = 0; 32_pos = 0; 42_pos = value; 133_pos--; 181_pos -= oldLength - newLength; 190_pos -= oldLength; 201_pos -= value.Length; 214_pos -= length; 239_pos += count; 263_pos += count; 274_pos = pos + 1; 294_pos = pos + 1; 315_pos += s.Length; 330_pos += count; 346_pos += length; 358_pos += value.Length; 370_pos = origPos + length;
37 references to _pos
Microsoft.ML.Tokenizers (37)
Utils\ValueStringBuilder.cs (37)
37get => _pos; 55Grow(capacity - _pos); 87Debug.Assert(index < _pos); 95Span<char> span = _chars.Slice(0, _pos); 104string s = _chars.Slice(0, _pos).ToString(); 123return _chars.Slice(0, _pos); 131if (_pos > 0) 137public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 138public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 143if (_chars.Slice(0, _pos).TryCopyTo(destination)) 145charsWritten = _pos; 163while (index <= _pos - oldLength) 165ReadOnlySpan<char> buffer = _chars.Slice(index, _pos - index); 180_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 189_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 210if (length > 0 && start + length <= _pos) 212int remaining = _pos - start - length; 221if (valueLength > _pos) 226return _chars.Slice(_pos - valueLength, valueLength).SequenceEqual(value.AsSpan()); 231if (_pos > _chars.Length - count) 236int remaining = _pos - index; 251if (_pos > (_chars.Length - count)) 256int remaining = _pos - index; 269int pos = _pos; 290int pos = _pos; 304int pos = _pos; 320if (_pos > _chars.Length - count) 325Span<char> dst = _chars.Slice(_pos, count); 335int pos = _pos; 341Span<char> dst = _chars.Slice(_pos, length); 351int pos = _pos; 357value.CopyTo(_chars.Slice(_pos)); 364int origPos = _pos; 386/// <see cref="_pos"/> whichever is greater. 395Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 400(uint)(_pos + additionalCapacityBeyondPos), 407_chars.Slice(0, _pos).CopyTo(poolArray);