Browse Source

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

pull/507/head 5.0-Beta5
Andreas Weizel 12 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
if (textSource == null) if (textSource == null)
return; return;
if (searchScopeList != null) { 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))) scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0)))
return; return;
} }
@ -216,7 +216,7 @@ namespace CSharpBinding
if (textSource == null) if (textSource == null)
return; return;
if (searchScopeList != null) { 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))) scope => (scope.SearchTerm == null) || (textSource.IndexOf(scope.SearchTerm, 0, textSource.TextLength, StringComparison.Ordinal) >= 0)))
return; return;
} }

Loading…
Cancel
Save