mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-21 01:18:02 +02:00
Fix for Debug.WriteLine() - Avoid potential String reallocation
Debug.WriteLine() no longer reallocate its scoped String when appending a newline. This only happened when the StringView length matches the buffersize in the String.
This commit is contained in:
parent
d778f2dd2f
commit
80f72fd35e
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ namespace System.Diagnostics
|
||||||
|
|
||||||
public static void WriteLine(StringView line)
|
public static void WriteLine(StringView line)
|
||||||
{
|
{
|
||||||
String lineStr = scope String(Math.Min(line.Length, 4096));
|
String lineStr = scope String(Math.Min(line.Length + 1, 4096));
|
||||||
lineStr.Append(line);
|
lineStr.Append(line);
|
||||||
lineStr.Append('\n');
|
lineStr.Append('\n');
|
||||||
Write(lineStr.Ptr, lineStr.Length);
|
Write(lineStr.Ptr, lineStr.Length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue