@@ -125,22 +125,22 @@ private static bool ContainsUpperCaseLetter(string pattern)
125125
126126 private PatternMatch ? MatchPatternChunk (
127127 string candidate ,
128- in TextChunk patternChunk ,
128+ ref TextChunk patternChunk ,
129129 bool punctuationStripped ,
130130 bool fuzzyMatch )
131131 {
132132 return fuzzyMatch
133- ? FuzzyMatchPatternChunk ( candidate , patternChunk , punctuationStripped )
133+ ? FuzzyMatchPatternChunk ( candidate , ref patternChunk , punctuationStripped )
134134 : NonFuzzyMatchPatternChunk ( candidate , patternChunk , punctuationStripped ) ;
135135 }
136136
137137 private static PatternMatch ? FuzzyMatchPatternChunk (
138138 string candidate ,
139- in TextChunk patternChunk ,
139+ ref TextChunk patternChunk ,
140140 bool punctuationStripped )
141141 {
142- Contract . ThrowIfNull ( patternChunk . SimilarityChecker ) ;
143- if ( patternChunk . SimilarityChecker . Value . AreSimilar ( candidate ) )
142+ Contract . ThrowIfTrue ( patternChunk . SimilarityChecker . IsDefault ) ;
143+ if ( patternChunk . SimilarityChecker . AreSimilar ( candidate ) )
144144 {
145145 return new PatternMatch (
146146 PatternMatchKind . Fuzzy , punctuationStripped , isCaseSensitive : false , matchedSpan : null ) ;
@@ -307,7 +307,7 @@ private static bool ContainsSpaceOrAsterisk(string text)
307307 /// <returns>If there's only one match, then the return value is that match. Otherwise it is null.</returns>
308308 private bool MatchPatternSegment (
309309 string candidate ,
310- in PatternSegment segment ,
310+ ref PatternSegment segment ,
311311 ref TemporaryArray < PatternMatch > matches ,
312312 bool fuzzyMatch )
313313 {
@@ -326,7 +326,7 @@ private bool MatchPatternSegment(
326326 if ( ! ContainsSpaceOrAsterisk ( segment . TotalTextChunk . Text ) )
327327 {
328328 var match = MatchPatternChunk (
329- candidate , segment . TotalTextChunk , punctuationStripped : false , fuzzyMatch : fuzzyMatch ) ;
329+ candidate , ref segment . TotalTextChunk , punctuationStripped : false , fuzzyMatch : fuzzyMatch ) ;
330330 if ( match != null )
331331 {
332332 matches . Add ( match . Value ) ;
@@ -354,7 +354,7 @@ private bool MatchPatternSegment(
354354 if ( subWordTextChunks . Length == 1 )
355355 {
356356 var result = MatchPatternChunk (
357- candidate , subWordTextChunks [ 0 ] , punctuationStripped : true , fuzzyMatch : fuzzyMatch ) ;
357+ candidate , ref subWordTextChunks [ 0 ] , punctuationStripped : true , fuzzyMatch : fuzzyMatch ) ;
358358 if ( result == null )
359359 {
360360 return false ;
@@ -367,11 +367,11 @@ private bool MatchPatternSegment(
367367 {
368368 using var tempMatches = TemporaryArray < PatternMatch > . Empty ;
369369
370- foreach ( var subWordTextChunk in subWordTextChunks )
370+ for ( int i = 0 , n = subWordTextChunks . Length ; i < n ; i ++ )
371371 {
372372 // Try to match the candidate with this word
373373 var result = MatchPatternChunk (
374- candidate , subWordTextChunk , punctuationStripped : true , fuzzyMatch : fuzzyMatch ) ;
374+ candidate , ref subWordTextChunks [ i ] , punctuationStripped : true , fuzzyMatch : fuzzyMatch ) ;
375375 if ( result == null )
376376 return false ;
377377
0 commit comments