Optimize code

This commit is contained in:
弘韬 张 2021-01-20 13:47:25 +08:00
parent ba236dad63
commit cd92512fe5
2 changed files with 8 additions and 3 deletions

View file

@ -28,7 +28,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
RecurseSubdirectories = true
}, query, search, criteria, token);
return DirectorySearch(null, query, search, criteria, token); // null will be passed as default
return DirectorySearch(new EnumerationOptions(), query, search, criteria, token); // null will be passed as default
}
public string ConstructSearchCriteria(string search)

View file

@ -80,12 +80,17 @@ namespace Flow.Launcher.Plugin.Explorer.Search
if (token.IsCancellationRequested)
return null;
results.AddRange(await TopLevelDirectorySearchBehaviourAsync(WindowsIndexTopLevelFolderSearchAsync,
var directoryResult = await TopLevelDirectorySearchBehaviourAsync(WindowsIndexTopLevelFolderSearchAsync,
DirectoryInfoClassSearch,
useIndexSearch,
query,
locationPath,
token).ConfigureAwait(false));
token).ConfigureAwait(false);
if (token.IsCancellationRequested)
return null;
results.AddRange(directoryResult);
return results;
}