Browse Source

Reduced unneeded lookup iterations when several symbol searches have the same search term.

pull/507/head 5.0-Beta5
Andreas Weizel 11 years ago
parent
commit
3e5b969d09
  1. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs

@ -131,7 +131,7 @@ namespace CSharpBinding @@ -131,7 +131,7 @@ namespace CSharpBinding
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;
}
@ -216,7 +216,7 @@ namespace CSharpBinding @@ -216,7 +216,7 @@ namespace CSharpBinding
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;
}

Loading…
Cancel
Save