Skip to content

Commit 4e4839b

Browse files
perf: remove unnecessary manual string.Replace code.
1 parent 680930b commit 4e4839b

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

TUnit.Core/Helpers/ArgumentFormatter.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,7 @@ private static string FormatDefault(object? o)
9696
return str;
9797
}
9898

99-
#if NET8_0_OR_GREATER
100-
// Use Span<char> for better performance - avoid string.Replace allocation
101-
Span<char> buffer = str.Length <= 256
102-
? stackalloc char[str.Length]
103-
: new char[str.Length];
104-
105-
for (int i = 0; i < str.Length; i++)
106-
{
107-
buffer[i] = str[i] == '.' ? '·' : str[i];
108-
}
109-
110-
return new string(buffer);
111-
#else
11299
return str.Replace(".", "·");
113-
#endif
114100
}
115101

116102
if (toString == type.FullName || toString == type.AssemblyQualifiedName)

0 commit comments

Comments
 (0)