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)
41
Debug.Assert(value <=
_chars
.Length);
46
public int Capacity =>
_chars
.Length;
54
if ((uint)capacity > (uint)
_chars
.Length)
66
return ref MemoryMarshal.GetReference(
_chars
);
78
_chars
[Length] = '\0';
80
return ref MemoryMarshal.GetReference(
_chars
);
88
return ref
_chars
[index];
95
Span<char> span =
_chars
.Slice(0, _pos);
104
string s =
_chars
.Slice(0, _pos).ToString();
110
public Span<char> RawChars =>
_chars
;
121
_chars
[Length] = '\0';
123
return
_chars
.Slice(0, _pos);
137
public ReadOnlySpan<char> AsSpan() =>
_chars
.Slice(0, _pos);
138
public ReadOnlySpan<char> AsSpan(int start) =>
_chars
.Slice(start, _pos - start);
139
public ReadOnlySpan<char> AsSpan(int start, int length) =>
_chars
.Slice(start, length);
143
if (
_chars
.Slice(0, _pos).TryCopyTo(destination))
165
ReadOnlySpan<char> buffer =
_chars
.Slice(index, _pos - index);
176
newValue.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));
226
return
_chars
.Slice(_pos - valueLength, valueLength).SequenceEqual(value.AsSpan());
231
if (_pos >
_chars
.Length - count)
237
_chars
.Slice(index, remaining).CopyTo(
_chars
.Slice(index + count));
238
_chars
.Slice(index, count).Fill(value);
251
if (_pos > (
_chars
.Length - count))
257
_chars
.Slice(index, remaining).CopyTo(
_chars
.Slice(index + count));
262
.CopyTo(
_chars
.Slice(index));
270
Span<char> chars =
_chars
;
291
if (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];
305
if (pos >
_chars
.Length - s.Length)
314
.CopyTo(
_chars
.Slice(pos));
320
if (_pos >
_chars
.Length - count)
325
Span<char> dst =
_chars
.Slice(_pos, count);
336
if (pos >
_chars
.Length - length)
341
Span<char> dst =
_chars
.Slice(_pos, length);
352
if (pos >
_chars
.Length - value.Length)
357
value.CopyTo(
_chars
.Slice(_pos));
365
if (origPos >
_chars
.Length - length)
371
return
_chars
.Slice(origPos, length);
395
Debug.Assert(_pos >
_chars
.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
401
Math.Min((uint)
_chars
.Length * 2, ArrayMaxLength));
407
_chars
.Slice(0, _pos).CopyTo(poolArray);