mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Code quality
This commit is contained in:
parent
2f1e009d70
commit
3e20c518a0
1 changed files with 4 additions and 5 deletions
|
|
@ -19,7 +19,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public ResultCollection Results { get; }
|
||||
|
||||
private readonly object _collectionLock = new object();
|
||||
private readonly object _collectionLock = new();
|
||||
private readonly Settings _settings;
|
||||
private int MaxResults => _settings?.MaxResultsToShow ?? 6;
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
#region Private Methods
|
||||
|
||||
private int InsertIndexOf(int newScore, IList<ResultViewModel> list)
|
||||
private static int InsertIndexOf(int newScore, IList<ResultViewModel> list)
|
||||
{
|
||||
int index = 0;
|
||||
for (; index < list.Count; index++)
|
||||
|
|
@ -118,7 +118,6 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
|
@ -190,10 +189,10 @@ namespace Flow.Launcher.ViewModel
|
|||
if (token.IsCancellationRequested)
|
||||
return;
|
||||
|
||||
UpdateResults(newResults, token, reselect);
|
||||
UpdateResults(newResults, reselect, token);
|
||||
}
|
||||
|
||||
private void UpdateResults(List<ResultViewModel> newResults, CancellationToken token = default, bool reselect = true)
|
||||
private void UpdateResults(List<ResultViewModel> newResults, bool reselect = true, CancellationToken token = default)
|
||||
{
|
||||
lock (_collectionLock)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue