Skip to content

Commit 178252b

Browse files
perf: replace StringBuilder with ValueStringBuilder
1 parent 88d5e68 commit 178252b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Refit/SeparatedCaseFormatter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ internal static string Format(string key, char separator)
2323
return key;
2424
}
2525

26-
var builder = new StringBuilder(key.Length + SeparatorCapacityHeadroom);
26+
var builder = new ValueStringBuilder(key.Length + SeparatorCapacityHeadroom);
2727
for (var i = 0; i < key.Length; i++)
2828
{
2929
var current = key[i];
3030
if (char.IsUpper(current))
3131
{
3232
if (i > 0 && NeedsSeparatorBefore(key, i))
3333
{
34-
_ = builder.Append(separator);
34+
builder.Append(separator);
3535
}
3636

37-
_ = builder.Append(char.ToLowerInvariant(current));
37+
builder.Append(char.ToLowerInvariant(current));
3838
}
3939
else
4040
{
41-
_ = builder.Append(current);
41+
builder.Append(current);
4242
}
4343
}
4444

0 commit comments

Comments
 (0)