Skip to content

Commit

Permalink
Revert change in StringBuilder.Append(char) (#74898)
Browse files Browse the repository at this point in the history
The change has a bad interaction with inlining heuristics.

Fixes #74158. Partial revert of #67448.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
github-actions[bot] and jkotas authored Sep 3, 2022
1 parent 36c60aa commit ce7e864
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1052,10 +1052,10 @@ public StringBuilder Append(char value)
int nextCharIndex = m_ChunkLength;
char[] chars = m_ChunkChars;

if ((uint)nextCharIndex < (uint)chars.Length)
if ((uint)chars.Length > (uint)nextCharIndex)
{
chars[nextCharIndex] = value;
m_ChunkLength = nextCharIndex + 1;
m_ChunkLength++;
}
else
{
Expand Down

0 comments on commit ce7e864

Please sign in to comment.