diff --git a/src/libraries/Common/src/System/Text/ValueStringBuilder.cs b/src/libraries/Common/src/System/Text/ValueStringBuilder.cs index 50dc63ad13b744..b89d7e01caf22e 100644 --- a/src/libraries/Common/src/System/Text/ValueStringBuilder.cs +++ b/src/libraries/Common/src/System/Text/ValueStringBuilder.cs @@ -170,9 +170,10 @@ public void Insert(int index, string? s) public void Append(char c) { int pos = _pos; - if ((uint)pos < (uint)_chars.Length) + Span chars = _chars; + if ((uint)pos < (uint)chars.Length) { - _chars[pos] = c; + chars[pos] = c; _pos = pos + 1; } else