diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index 7bc773d28..3b03f89f6 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -99,7 +99,7 @@ namespace Flow.Launcher.Plugin.Program var b = Task.Run(() => { - Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexUwpPrograms); + Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPProgram index cost", IndexUwpPrograms); }); if (cacheEmpty) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs index 86511a422..fb4603622 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs @@ -41,13 +41,8 @@ namespace Flow.Launcher.Plugin.Program.Programs FullName = package.Id.FullName; FamilyName = package.Id.FamilyName; InitializeAppInfo(); - Apps = Apps.Where(a => - { - var valid = - !string.IsNullOrEmpty(a.UserModelId) && - !string.IsNullOrEmpty(a.DisplayName); - return valid; - }).ToArray(); + Apps = Apps.Where(a => !string.IsNullOrEmpty(a.UserModelId) && !string.IsNullOrEmpty(a.DisplayName)) + .ToArray(); } private void InitializeAppInfo() @@ -80,7 +75,7 @@ namespace Flow.Launcher.Plugin.Program.Programs ProgramLogger.LogException($"|UWP|InitializeAppInfo|{path}" + "|Error caused while trying to get the details of the UWP program", e); - Apps = new List().ToArray(); + Apps = Array.Empty(); } if (stream != null && Marshal.ReleaseComObject(stream) > 0) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index b5969affc..deb297ca6 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -496,7 +496,7 @@ namespace Flow.Launcher.Plugin.Program.Programs if (temp.Any()) return DistinctBy(temp, x => x.Description); return g.Take(1); - }).ToArray(); + }); } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs index a7ee299d5..1ee18ae37 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Input; @@ -224,7 +223,7 @@ namespace Flow.Launcher.Plugin.Program.Views } } - if (directoriesToAdd.Count() > 0) + if (directoriesToAdd.Count > 0) { directoriesToAdd.ForEach(x => _settings.ProgramSources.Add(x)); directoriesToAdd.ForEach(x => ProgramSettingDisplayList.Add(x)); @@ -347,8 +346,8 @@ namespace Flow.Launcher.Plugin.Program.Views private void programSourceView_SelectionChanged(object sender, SelectionChangedEventArgs e) { var selectedItems = programSourceView - .SelectedItems.Cast() - .ToList(); + .SelectedItems.Cast() + .ToList(); if (IsAllItemsUserAdded(selectedItems)) {