3 writes to _chars
Microsoft.AspNetCore.Http.Extensions (3)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (3)
21
_chars
= initialBuffer;
28
_chars
= _arrayToReturnToPool;
298
_chars
= _arrayToReturnToPool = poolArray;
40 references to _chars
Microsoft.AspNetCore.Http.Extensions (40)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (40)
38
Debug.Assert(value <=
_chars
.Length);
43
public int Capacity =>
_chars
.Length;
51
if ((uint)capacity > (uint)
_chars
.Length)
65
return ref MemoryMarshal.GetReference(
_chars
);
77
_chars
[Length] = '\0';
79
return ref MemoryMarshal.GetReference(
_chars
);
87
return ref
_chars
[index];
93
string s =
_chars
.Slice(0, _pos).ToString();
99
public Span<char> RawChars =>
_chars
;
110
_chars
[Length] = '\0';
112
return
_chars
.Slice(0, _pos);
115
public ReadOnlySpan<char> AsSpan() =>
_chars
.Slice(0, _pos);
116
public ReadOnlySpan<char> AsSpan(int start) =>
_chars
.Slice(start, _pos - start);
117
public ReadOnlySpan<char> AsSpan(int start, int length) =>
_chars
.Slice(start, length);
121
if (
_chars
.Slice(0, _pos).TryCopyTo(destination))
137
if (_pos >
_chars
.Length - count)
143
_chars
.Slice(index, remaining).CopyTo(
_chars
.Slice(index + count));
144
_chars
.Slice(index, count).Fill(value);
157
if (_pos > (
_chars
.Length - count))
163
_chars
.Slice(index, remaining).CopyTo(
_chars
.Slice(index + count));
164
s.AsSpan().CopyTo(
_chars
.Slice(index));
172
if ((uint)pos < (uint)
_chars
.Length)
174
_chars
[pos] = c;
192
if (s.Length == 1 && (uint)pos < (uint)
_chars
.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc.
194
_chars
[pos] = s[0];
206
if (pos >
_chars
.Length - s.Length)
211
s.AsSpan().CopyTo(
_chars
.Slice(pos));
217
if (_pos >
_chars
.Length - count)
222
Span<char> dst =
_chars
.Slice(_pos, count);
233
if (pos >
_chars
.Length - length)
238
Span<char> dst =
_chars
.Slice(_pos, length);
249
if (pos >
_chars
.Length - value.Length)
254
value.CopyTo(
_chars
.Slice(_pos));
262
if (origPos >
_chars
.Length - length)
268
return
_chars
.Slice(origPos, length);
290
Debug.Assert(_pos >
_chars
.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
293
char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)
_chars
.Length * 2));
295
_chars
.Slice(0, _pos).CopyTo(poolArray);