3 writes to _chars
Microsoft.ML.Tokenizers (3)
Utils\ValueStringBuilder.cs (3)
24_chars = initialBuffer; 31_chars = _arrayToReturnToPool; 410_chars = _arrayToReturnToPool = poolArray;
49 references to _chars
Microsoft.ML.Tokenizers (49)
Utils\ValueStringBuilder.cs (49)
41Debug.Assert(value <= _chars.Length); 46public int Capacity => _chars.Length; 54if ((uint)capacity > (uint)_chars.Length) 66return ref MemoryMarshal.GetReference(_chars); 78_chars[Length] = '\0'; 80return ref MemoryMarshal.GetReference(_chars); 88return ref _chars[index]; 95Span<char> span = _chars.Slice(0, _pos); 104string s = _chars.Slice(0, _pos).ToString(); 110public Span<char> RawChars => _chars; 121_chars[Length] = '\0'; 123return _chars.Slice(0, _pos); 137public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 138public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 139public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 143if (_chars.Slice(0, _pos).TryCopyTo(destination)) 165ReadOnlySpan<char> buffer = _chars.Slice(index, _pos - index); 176newValue.AsSpan().CopyTo(_chars.Slice(index)); 180_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 189_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 213_chars.Slice(start + length, remaining).CopyTo(_chars.Slice(start)); 226return _chars.Slice(_pos - valueLength, valueLength).SequenceEqual(value.AsSpan()); 231if (_pos > _chars.Length - count) 237_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 238_chars.Slice(index, count).Fill(value); 251if (_pos > (_chars.Length - count)) 257_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 262.CopyTo(_chars.Slice(index)); 270Span<char> chars = _chars; 291if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 293_chars[pos] = s[0]; 305if (pos > _chars.Length - s.Length) 314.CopyTo(_chars.Slice(pos)); 320if (_pos > _chars.Length - count) 325Span<char> dst = _chars.Slice(_pos, count); 336if (pos > _chars.Length - length) 341Span<char> dst = _chars.Slice(_pos, length); 352if (pos > _chars.Length - value.Length) 357value.CopyTo(_chars.Slice(_pos)); 365if (origPos > _chars.Length - length) 371return _chars.Slice(origPos, length); 395Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 401Math.Min((uint)_chars.Length * 2, ArrayMaxLength)); 407_chars.Slice(0, _pos).CopyTo(poolArray);