Skip to content

Commit cd92512

Browse files
committed
Optimize code
1 parent ba236da commit cd92512

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal List<Result> TopLevelDirectorySearch(Query query, string search, Cancel
2828
RecurseSubdirectories = true
2929
}, query, search, criteria, token);
3030

31-
return DirectorySearch(null, query, search, criteria, token); // null will be passed as default
31+
return DirectorySearch(new EnumerationOptions(), query, search, criteria, token); // null will be passed as default
3232
}
3333

3434
public string ConstructSearchCriteria(string search)

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,17 @@ internal async Task<List<Result>> SearchAsync(Query query, CancellationToken tok
8080
if (token.IsCancellationRequested)
8181
return null;
8282

83-
results.AddRange(await TopLevelDirectorySearchBehaviourAsync(WindowsIndexTopLevelFolderSearchAsync,
83+
var directoryResult = await TopLevelDirectorySearchBehaviourAsync(WindowsIndexTopLevelFolderSearchAsync,
8484
DirectoryInfoClassSearch,
8585
useIndexSearch,
8686
query,
8787
locationPath,
88-
token).ConfigureAwait(false));
88+
token).ConfigureAwait(false);
89+
90+
if (token.IsCancellationRequested)
91+
return null;
92+
93+
results.AddRange(directoryResult);
8994

9095
return results;
9196
}

0 commit comments

Comments
 (0)