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)
38Debug.Assert(value <= _chars.Length); 43public readonly int Capacity => _chars.Length; 51if ((uint)capacity > (uint)_chars.Length) 61public readonly ref char GetPinnableReference() => ref MemoryMarshal.GetReference(_chars); 72_chars[Length] = '\0'; 75return ref MemoryMarshal.GetReference(_chars); 83return ref _chars[index]; 89string s = _chars[.._pos].ToString(); 95public readonly Span<char> RawChars => _chars; 106_chars[Length] = '\0'; 109return _chars[.._pos]; 112public readonly ReadOnlySpan<char> AsSpan() => _chars[.._pos]; 113public readonly ReadOnlySpan<char> AsSpan(int start) => _chars[start.._pos]; 114public readonly ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 118if (_chars[.._pos].TryCopyTo(destination)) 134if (_pos > _chars.Length - count) 140_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 141_chars.Slice(index, count).Fill(value); 154if (_pos > (_chars.Length - count)) 160_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 161s.CopyTo(_chars[index..]); 169if ((uint)pos < (uint)_chars.Length) 171_chars[pos] = c; 189if (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]; 203if (pos > _chars.Length - s.Length) 208s.CopyTo(_chars[pos..]); 214if (_pos > _chars.Length - count) 219Span<char> dst = _chars.Slice(_pos, count); 231if (pos > _chars.Length - length) 236Span<char> dst = _chars.Slice(_pos, length); 248if (pos > _chars.Length - value.Length) 253value.CopyTo(_chars[_pos..]); 261if (origPos > _chars.Length - length) 267return _chars.Slice(origPos, length); 289Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 297Math.Min((uint)_chars.Length * 2, ArrayMaxLength)); 303_chars[.._pos].CopyTo(poolArray);