diff --git a/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs b/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs index 11a2a5f..09e18b1 100644 --- a/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/POC/DelegateVsComparerPoc.Benchmarks.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Attributes; -using MiscUtil; namespace Recyclable.Collections.Benchmarks.POC { @@ -49,23 +48,13 @@ namespace Recyclable.Collections.Benchmarks.POC public readonly struct MyComparerReadOnlyStruct : IComparer { - public int Compare(T? x, T? y) => Operator.Subtract(x, y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0, - }; + public int Compare(T? x, T? y) => Comparer.Default.Compare(x, y); } private struct MyComparerStruct : IComparer { - public int Compare(T? x, T? y) => Operator.Subtract(x, y) switch - { - > 0 => 1, - < 0 => -1, - _ => 0, - }; - } + public int Compare(T? x, T? y) => Comparer.Default.Compare(x, y); + } private class MyComparer : IComparer { diff --git a/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj b/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj index c409138..7f853f9 100644 --- a/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj +++ b/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj @@ -1,4 +1,4 @@ - + Exe @@ -13,7 +13,6 @@ -