3 writes to _chars
System.Drawing.Common (3)
src\Common\src\ValueStringBuilder.cs (3)
21
_chars
= initialBuffer;
28
_chars
= _arrayToReturnToPool;
306
_chars
= _arrayToReturnToPool = poolArray;
40 references to _chars
System.Drawing.Common (40)
src\Common\src\ValueStringBuilder.cs (40)
38
Debug.Assert(value <=
_chars
.Length);
43
public readonly int Capacity =>
_chars
.Length;
51
if ((uint)capacity > (uint)
_chars
.Length)
61
public readonly ref char GetPinnableReference() => ref MemoryMarshal.GetReference(
_chars
);
72
_chars
[Length] = '\0';
75
return ref MemoryMarshal.GetReference(
_chars
);
83
return ref
_chars
[index];
89
string s =
_chars
[.._pos].ToString();
95
public readonly Span<char> RawChars =>
_chars
;
106
_chars
[Length] = '\0';
109
return
_chars
[.._pos];
112
public readonly ReadOnlySpan<char> AsSpan() =>
_chars
[.._pos];
113
public readonly ReadOnlySpan<char> AsSpan(int start) =>
_chars
[start.._pos];
114
public readonly ReadOnlySpan<char> AsSpan(int start, int length) =>
_chars
.Slice(start, length);
118
if (
_chars
[.._pos].TryCopyTo(destination))
134
if (_pos >
_chars
.Length - count)
140
_chars
.Slice(index, remaining).CopyTo(
_chars
[(index + count)..]);
141
_chars
.Slice(index, count).Fill(value);
154
if (_pos > (
_chars
.Length - count))
160
_chars
.Slice(index, remaining).CopyTo(
_chars
[(index + count)..]);
161
s.CopyTo(
_chars
[index..]);
169
if ((uint)pos < (uint)
_chars
.Length)
171
_chars
[pos] = c;
189
if (s.Length == 1 && (uint)pos < (uint)
_chars
.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc.
191
_chars
[pos] = s[0];
203
if (pos >
_chars
.Length - s.Length)
208
s.CopyTo(
_chars
[pos..]);
214
if (_pos >
_chars
.Length - count)
219
Span<char> dst =
_chars
.Slice(_pos, count);
231
if (pos >
_chars
.Length - length)
236
Span<char> dst =
_chars
.Slice(_pos, length);
248
if (pos >
_chars
.Length - value.Length)
253
value.CopyTo(
_chars
[_pos..]);
261
if (origPos >
_chars
.Length - length)
267
return
_chars
.Slice(origPos, length);
289
Debug.Assert(_pos >
_chars
.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
297
Math.Min((uint)
_chars
.Length * 2, ArrayMaxLength));
303
_chars
[.._pos].CopyTo(poolArray);