Skip to content

Commit

Permalink
Revert change in StringBuilder.Append(char) (#74885)
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.
  • Loading branch information
jkotas authored Sep 1, 2022
1 parent 7922d61 commit fccff6e
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 fccff6e

Please sign in to comment.