Skip to content

Commit 0b247db

Browse files
minor changes
1 parent cc7d2bc commit 0b247db

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

Plugins/Flow.Launcher.Plugin.Program/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public async Task InitAsync(PluginInitContext context)
9999

100100
var b = Task.Run(() =>
101101
{
102-
Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexUwpPrograms);
102+
Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPProgram index cost", IndexUwpPrograms);
103103
});
104104

105105
if (cacheEmpty)

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,8 @@ public UWP(Package package)
4141
FullName = package.Id.FullName;
4242
FamilyName = package.Id.FamilyName;
4343
InitializeAppInfo();
44-
Apps = Apps.Where(a =>
45-
{
46-
var valid =
47-
!string.IsNullOrEmpty(a.UserModelId) &&
48-
!string.IsNullOrEmpty(a.DisplayName);
49-
return valid;
50-
}).ToArray();
44+
Apps = Apps.Where(a => !string.IsNullOrEmpty(a.UserModelId) && !string.IsNullOrEmpty(a.DisplayName))
45+
.ToArray();
5146
}
5247

5348
private void InitializeAppInfo()
@@ -80,7 +75,7 @@ private void InitializeAppInfo()
8075
ProgramLogger.LogException($"|UWP|InitializeAppInfo|{path}" +
8176
"|Error caused while trying to get the details of the UWP program", e);
8277

83-
Apps = new List<Application>().ToArray();
78+
Apps = Array.Empty<Application>();
8479
}
8580

8681
if (stream != null && Marshal.ReleaseComObject(stream) > 0)

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ private static IEnumerable<Win32> ProgramsHasher(IEnumerable<Win32> programs)
496496
if (temp.Any())
497497
return DistinctBy(temp, x => x.Description);
498498
return g.Take(1);
499-
}).ToArray();
499+
});
500500
}
501501

502502

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Collections.Generic;
22
using System.IO;
33
using System.Linq;
4-
using System.Threading.Tasks;
54
using System.Windows;
65
using System.Windows.Controls;
76
using System.Windows.Input;
@@ -224,7 +223,7 @@ private void programSourceView_Drop(object sender, DragEventArgs e)
224223
}
225224
}
226225

227-
if (directoriesToAdd.Count() > 0)
226+
if (directoriesToAdd.Count > 0)
228227
{
229228
directoriesToAdd.ForEach(x => _settings.ProgramSources.Add(x));
230229
directoriesToAdd.ForEach(x => ProgramSettingDisplayList.Add(x));
@@ -347,8 +346,8 @@ private static bool HasMoreOrEqualEnabledItems(List<ProgramSource> items)
347346
private void programSourceView_SelectionChanged(object sender, SelectionChangedEventArgs e)
348347
{
349348
var selectedItems = programSourceView
350-
.SelectedItems.Cast<ProgramSource>()
351-
.ToList();
349+
.SelectedItems.Cast<ProgramSource>()
350+
.ToList();
352351

353352
if (IsAllItemsUserAdded(selectedItems))
354353
{

0 commit comments

Comments
 (0)