File tree Expand file tree Collapse file tree 1 file changed +15
-21
lines changed
Plugins/Flow.Launcher.Plugin.Program Expand file tree Collapse file tree 1 file changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -71,21 +71,17 @@ public List<Result> Query(Query query)
71
71
Win32 [ ] win32 ;
72
72
UWP . Application [ ] uwps ;
73
73
74
- lock ( IndexLock )
75
- { // just take the reference inside the lock to eliminate query time issues.
76
- win32 = _win32s ;
77
- uwps = _uwps ;
78
- }
79
-
80
- var results1 = win32 . AsParallel ( )
81
- . Where ( p => p . Enabled )
82
- . Select ( p => p . Result ( query . Search , _context . API ) ) ;
74
+ win32 = _win32s ;
75
+ uwps = _uwps ;
83
76
84
- var results2 = uwps . AsParallel ( )
85
- . Where ( p => p . Enabled )
86
- . Select ( p => p . Result ( query . Search , _context . API ) ) ;
77
+ var result = win32 . Cast < IProgram > ( )
78
+ . Concat ( uwps )
79
+ . AsParallel ( )
80
+ . Where ( p => p . Enabled )
81
+ . Select ( p => p . Result ( query . Search , _context . API ) )
82
+ . Where ( r => r ? . Score > 0 )
83
+ . ToList ( ) ;
87
84
88
- var result = results1 . Concat ( results2 ) . Where ( r => r != null && r . Score > 0 ) . ToList ( ) ;
89
85
return result ;
90
86
}
91
87
@@ -97,10 +93,9 @@ public void Init(PluginInitContext context)
97
93
public static void IndexWin32Programs ( )
98
94
{
99
95
var win32S = Win32 . All ( _settings ) ;
100
- lock ( IndexLock )
101
- {
102
- _win32s = win32S ;
103
- }
96
+
97
+ _win32s = win32S ;
98
+
104
99
}
105
100
106
101
public static void IndexUWPPrograms ( )
@@ -109,10 +104,9 @@ public static void IndexUWPPrograms()
109
104
var support = Environment . OSVersion . Version . Major >= windows10 . Major ;
110
105
111
106
var applications = support ? UWP . All ( ) : new UWP . Application [ ] { } ;
112
- lock ( IndexLock )
113
- {
114
- _uwps = applications ;
115
- }
107
+
108
+ _uwps = applications ;
109
+
116
110
}
117
111
118
112
public static void IndexPrograms ( )
You can’t perform that action at this time.
0 commit comments