File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -90,27 +90,7 @@ private static string FormatDefault(object? o)
9090 if ( o is string str )
9191 {
9292 // Replace dots with middle dot (·) to prevent VS Test Explorer from interpreting them as namespace separators
93- // Only do this if the string contains dots, to avoid unnecessary allocations
94- if ( ! str . Contains ( '.' ) )
95- {
96- return str ;
97- }
98-
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
11293 return str . Replace ( "." , "·" ) ;
113- #endif
11494 }
11595
11696 if ( toString == type . FullName || toString == type . AssemblyQualifiedName )
You can’t perform that action at this time.
0 commit comments