@@ -52,14 +52,13 @@ namespace CSharpBinding
5252 /// </summary>
5353 public class CSharpSymbolSearch : ISymbolSearch
5454 {
55- IProject project ;
56- ICompilation compilation ;
57- FindReferences fr = new FindReferences ( ) ;
58- IList < IFindReferenceSearchScope > searchScopes ;
59- IList < string > [ ] interestingFileNames ;
60- Dictionary < string , IList < IFindReferenceSearchScope > > searchScopesPerFile ;
61- int workAmount ;
62- double workAmountInverse ;
55+ readonly IProject project ;
56+ readonly ICompilation compilation ;
57+ readonly FindReferences fr = new FindReferences ( ) ;
58+ readonly IList < IFindReferenceSearchScope > searchScopes ;
59+ readonly Dictionary < string , IList < IFindReferenceSearchScope > > searchScopesPerFile ;
60+ readonly int workAmount ;
61+ readonly double workAmountInverse ;
6362
6463 public CSharpSymbolSearch ( IProject project , ISymbol entity )
6564 {
@@ -73,17 +72,15 @@ public CSharpSymbolSearch(IProject project, ISymbol entity)
7372 }
7473
7574 searchScopesPerFile = new Dictionary < string , IList < IFindReferenceSearchScope > > ( ) ;
76- interestingFileNames = new IList < string > [ searchScopes . Count ] ;
7775 for ( int i = 0 ; i < searchScopes . Count ; i ++ ) {
7876 var thisSearchScope = searchScopes [ i ] ;
79- var interestingFiles = fr . GetInterestingFiles ( thisSearchScope , compilation ) . Select ( f => f . FileName ) . ToList ( ) ;
77+ var interestingFiles = fr . GetInterestingFiles ( thisSearchScope , compilation ) . Select ( f => f . FileName ) ;
8078 foreach ( var file in interestingFiles ) {
8179 if ( ! searchScopesPerFile . ContainsKey ( file ) )
8280 searchScopesPerFile [ file ] = new List < IFindReferenceSearchScope > ( ) ;
8381 searchScopesPerFile [ file ] . Add ( thisSearchScope ) ;
82+ workAmount ++ ;
8483 }
85- interestingFileNames [ i ] = interestingFiles . ToList ( ) ;
86- workAmount += interestingFiles . Count ;
8784 }
8885 workAmountInverse = 1.0 / workAmount ;
8986 }
0 commit comments