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

Commit

Permalink
Using StringBuilder.Clear instead of creating a new one wasn't really…
Browse files Browse the repository at this point in the history
… an optimization

We don't have to care about the previous instance anyway since it's being garbage collected
  • Loading branch information
Laiteux committed Dec 18, 2020
1 parent 1649b0d commit 512edfe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Milky/ConsoleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ public ConsoleManager(Checker checker)
/// <param name="suffix">Suffix to add to title, can be useful for uh idk</param>
public async Task StartUpdatingTitleAsync(TimeSpan updateInterval, bool showFree = true, bool showPercentages = true, string prefix = null, string suffix = null)
{
var title = new StringBuilder();

while (true)
{
title.Clear().Append(prefix).Append(_checker.Info.Status);
var title = new StringBuilder().Append(prefix).Append(_checker.Info.Status);

if (_checker.Info.Status != CheckerStatus.Idle)
{
Expand Down

0 comments on commit 512edfe

Please sign in to comment.