Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert change in StringBuilder.Append(char)
The change has a bad interaction with inlining heuristics.

Fixes #74158. Partial revert of #67448.
  • Loading branch information
jkotas committed Aug 31, 2022
commit 64ea0dbcec450ae0ee8d83b177a77da05dde3da1
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