Skip to content

Commit 1e77b7e

Browse files
authored
Merge pull request #205 from filzrev/chore-fix-zlinqbenchmarkfilter
chore: Fix ZLinqBenchmarkFilter exclude condition
2 parents 0d22896 + d6ed51c commit 1e77b7e

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

sandbox/Benchmark/BenchmarkDotNet/Filters/ZLinqBenchmarkFilter.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,11 @@ namespace Benchmark;
1010
/// </summary>
1111
public partial class ZLinqBenchmarkFilter : IFilter
1212
{
13-
[GeneratedRegex(@"Benchmark.ZLinq.*", RegexOptions.CultureInvariant)]
14-
public static partial Regex ZLinqNamespaceRegex();
15-
1613
public virtual bool Predicate(BenchmarkCase benchmarkCase)
1714
{
1815
// Filter by namespace
19-
var fullBenchmarkName = FullNameProvider.GetBenchmarkName(benchmarkCase);
20-
var nameWithoutArgs = benchmarkCase.Descriptor.GetFilterName();
21-
22-
bool isMatched = ZLinqNamespaceRegex().IsMatch(fullBenchmarkName)
23-
|| ZLinqNamespaceRegex().IsMatch(nameWithoutArgs);
24-
25-
if (!isMatched)
16+
var ns = benchmarkCase.Descriptor.Type.Namespace!;
17+
if (!ns.StartsWith("Benchmark.ZLinq"))
2618
return false;
2719

2820
switch (benchmarkCase.Job.Id)

sandbox/Benchmark/Benchmarks/DistinctBattle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public bool TryGetSpan(out ReadOnlySpan<TSource> span)
9393
return false;
9494
}
9595

96-
public bool TryCopyTo(Span<TSource> destination, Index offset) => false;
96+
public bool TryCopyTo(scoped Span<TSource> destination, Index offset) => false;
9797

9898
public bool TryGetNext(out TSource current)
9999
{

0 commit comments

Comments
 (0)