From e73b2a05ce14acc3513a6293581655322599892f Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 16 Mar 2021 07:12:36 +1100 Subject: [PATCH] change to for loop --- .../Search/SearchManager.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index e78324718..a1fc6f6ed 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -1,4 +1,4 @@ -using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; +using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo; using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex; using Flow.Launcher.Plugin.SharedCommands; @@ -162,24 +162,24 @@ namespace Flow.Launcher.Plugin.Explorer.Search token).ConfigureAwait(false); } - private HashSet FilterOutResultsFromWindowsIndexExclusionList(HashSet results) + private HashSet FilterOutResultsFromWindowsIndexExclusionList(List results) { var indexExclusionList = settings.IndexSearchExcludedSubdirectoryPaths; var indexExclusionListCount = indexExclusionList.Count; if (indexExclusionListCount == 0) - return results; + return results.ToHashSet(); var filteredResults = new HashSet(PathEqualityComparator.Instance); - foreach (var r in results) + for (var index = 0; index < results.Count; index++) { var excludeResult = false; for (var i = 0; i < indexExclusionListCount; i++) { - if (r.SubTitle.StartsWith(indexExclusionList[i].Path, StringComparison.OrdinalIgnoreCase)) + if (results[index].SubTitle.StartsWith(indexExclusionList[i].Path, StringComparison.OrdinalIgnoreCase)) { excludeResult = true; break; @@ -187,7 +187,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } if (!excludeResult) - filteredResults.Add(r); + filteredResults.Add(results[index]); } return filteredResults;