Skip to content

Commit 5e15288

Browse files
committed
Optimize Append method in ValueStringBuilder for improved performance
1 parent 4bd5ff6 commit 5e15288

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/Falko.ZeroLogger/Builders/ValueStringBuilder.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ public void Append(string symbols)
7474
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7575
public void Append(char symbol, int repeat)
7676
{
77-
for (var iteration = 0; iteration < repeat; iteration++)
78-
{
79-
_span[_position + iteration] = symbol;
80-
}
81-
77+
_span.Slice(_position, repeat).Fill(symbol);
8278
_position += repeat;
8379
}
8480

0 commit comments

Comments
 (0)