Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Reduced unneeded lookup iterations when several symbol searches have …
Browse files Browse the repository at this point in the history
…the same search term.
  • Loading branch information
Rpinski committed Jun 28, 2014
1 parent 8485318 commit 3e5b969
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void FindReferencesInFile(SymbolSearchArgs args, IList<IFindReferenceSearchScope
if (textSource == null)
return;
if (searchScopeList != null) {
if (!searchScopeList.Any(
if (!searchScopeList.DistinctBy(scope => scope.SearchTerm ?? String.Empty).Any(
scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0)))
return;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ void RenameReferencesInFile(SymbolRenameArgs args, IList<IFindReferenceSearchSco
if (textSource == null)
return;
if (searchScopeList != null) {
if (!searchScopeList.Any(
if (!searchScopeList.DistinctBy(scope => scope.SearchTerm ?? String.Empty).Any(
scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0)))
return;
}
Expand Down

0 comments on commit 3e5b969

Please sign in to comment.