Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit 512edfe

Browse files
committed
Using StringBuilder.Clear instead of creating a new one wasn't really an optimization
We don't have to care about the previous instance anyway since it's being garbage collected
1 parent 1649b0d commit 512edfe

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Milky/ConsoleManager.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ public ConsoleManager(Checker checker)
2525
/// <param name="suffix">Suffix to add to title, can be useful for uh idk</param>
2626
public async Task StartUpdatingTitleAsync(TimeSpan updateInterval, bool showFree = true, bool showPercentages = true, string prefix = null, string suffix = null)
2727
{
28-
var title = new StringBuilder();
29-
3028
while (true)
3129
{
32-
title.Clear().Append(prefix).Append(_checker.Info.Status);
30+
var title = new StringBuilder().Append(prefix).Append(_checker.Info.Status);
3331

3432
if (_checker.Info.Status != CheckerStatus.Idle)
3533
{

0 commit comments

Comments
 (0)