Skip to content

Commit 23cf8f1

Browse files
committed
Improve tab string performance
1 parent c55d88d commit 23cf8f1

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

Flow.Launcher.Localization.Shared/Helper.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Linq;
3-
using System.Text;
1+
using System.Linq;
42
using System.Threading;
53
using Microsoft.CodeAnalysis;
64
using Microsoft.CodeAnalysis.CSharp;
@@ -88,16 +86,7 @@ private static Location GetCodeFixLocation(PropertyDeclarationSyntax property, S
8886

8987
public static string Spacing(int n)
9088
{
91-
Span<char> spaces = stackalloc char[n * 4];
92-
spaces.Fill(' ');
93-
94-
var sb = new StringBuilder(n * 4);
95-
foreach (var c in spaces)
96-
{
97-
_ = sb.Append(c);
98-
}
99-
100-
return sb.ToString();
89+
return new string(' ', n * 4);
10190
}
10291

10392
#endregion

0 commit comments

Comments
 (0)