@@ -13,12 +13,10 @@ public static void ReplaceGuids(StringBuilder builder, Counter counter)
1313 return ;
1414 }
1515
16- var context = new MatchContext ( counter ) ;
17-
18- CrossChunkMatcher . ReplaceAll < MatchContext > (
16+ CrossChunkMatcher . ReplaceAll (
1917 builder ,
2018 carryoverSize : 35 ,
21- context ,
19+ counter ,
2220 OnCrossChunk ,
2321 OnWithinChunk ) ;
2422 }
@@ -30,7 +28,7 @@ static void OnCrossChunk(
3028 int remainingInCarryover ,
3129 CharSpan currentChunkSpan ,
3230 int absoluteStartPosition ,
33- MatchContext context ,
31+ Counter counter ,
3432 Action < Match > addMatch )
3533 {
3634 var neededFromCurrent = 36 - remainingInCarryover ;
@@ -65,7 +63,7 @@ static void OnCrossChunk(
6563 return ;
6664 }
6765
68- var convert = context . Counter . Convert ( guid ) ;
66+ var convert = counter . Convert ( guid ) ;
6967 addMatch ( new ( absoluteStartPosition , 36 , convert ) ) ;
7068 }
7169
@@ -74,7 +72,7 @@ static int OnWithinChunk(
7472 CharSpan chunkSpan ,
7573 int chunkIndex ,
7674 int absoluteIndex ,
77- MatchContext context ,
75+ Counter counter ,
7876 Action < Match > addMatch )
7977 {
8078 var end = chunkIndex + 36 ;
@@ -101,7 +99,7 @@ static int OnWithinChunk(
10199 return 1 ;
102100 }
103101
104- var convert = context . Counter . Convert ( guid ) ;
102+ var convert = counter . Convert ( guid ) ;
105103 addMatch ( new ( absoluteIndex , 36 , convert ) ) ;
106104 return 36 ; // Skip past the matched GUID
107105 }
@@ -119,9 +117,4 @@ static bool IsInvalidStartingChar(char ch) =>
119117 IsInvalidChar ( ch ) &&
120118 ch != '{' &&
121119 ch != '(' ;
122-
123- sealed class MatchContext ( Counter counter )
124- {
125- public Counter Counter { get ; } = counter ;
126- }
127120}
0 commit comments