Skip to content

Commit 621a50e

Browse files
committed
.
1 parent 448915d commit 621a50e

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/Verify/Serialization/Scrubbers/DateScrubber.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static void ReplaceInner(StringBuilder builder, string format, Counter counter,
208208

209209
var context = new MatchContext(format, counter, culture, tryConvert, max, min);
210210

211-
CrossChunkMatcher.ReplaceAll<MatchContext>(
211+
CrossChunkMatcher.ReplaceAll(
212212
builder,
213213
carryoverSize: max - 1,
214214
context,

src/Verify/Serialization/Scrubbers/DirectoryReplacements_StringBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static void Replace(StringBuilder builder, List<Pair> paths)
4141
var maxLength = paths[0].Find.Length;
4242
var context = new MatchContext(paths);
4343

44-
CrossChunkMatcher.ReplaceAll<MatchContext>(
44+
CrossChunkMatcher.ReplaceAll(
4545
builder,
4646
carryoverSize: maxLength - 1,
4747
context,

src/Verify/Serialization/Scrubbers/GuidScrubber.cs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)