Skip to content

Commit 35e4bfc

Browse files
committed
Improve code quality
1 parent 4ed1dc3 commit 35e4bfc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,10 +1413,10 @@ async Task QueryHistoryTaskAsync()
14131413
await Task.Yield();
14141414

14151415
// Select last history results and revert its order to make sure last history results are on top
1416-
var lastHistoryResults = _history.Items.TakeLast(Settings.MaxHistoryResultsToShowForHomePage).Reverse();
1416+
var historyResults = _history.Items.TakeLast(Settings.MaxHistoryResultsToShowForHomePage).Reverse();
14171417

1418-
var historyResults = new List<Result>();
1419-
foreach (var h in lastHistoryResults)
1418+
var results = new List<Result>();
1419+
foreach (var h in historyResults)
14201420
{
14211421
var title = App.API.GetTranslation("executeQuery");
14221422
var time = App.API.GetTranslation("lastExecuteTime");
@@ -1438,14 +1438,12 @@ async Task QueryHistoryTaskAsync()
14381438
return false;
14391439
}
14401440
};
1441-
historyResults.Add(result);
1441+
results.Add(result);
14421442
}
14431443

1444-
// No need to make copy of results and update badge ico property
1445-
14461444
if (_updateSource.Token.IsCancellationRequested) return;
14471445

1448-
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(historyResults, _historyMetadata, query,
1446+
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(results, _historyMetadata, query,
14491447
_updateSource.Token)))
14501448
{
14511449
App.API.LogError(ClassName, "Unable to add item to Result Update Queue");

0 commit comments

Comments
 (0)