From aefd68d6c857b002b623e62b72f6f3283531837c Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sun, 25 Jun 2023 00:08:37 +0200 Subject: [PATCH] JonSkeet.MiscUtil package removed --- .../POC/DelegateVsComparerPoc.Benchmarks.cs | 17 +++-------------- .../Recyclable.Collections.Benchmarks.csproj | 3 +-- 2 files changed, 4 insertions(+), 16 deletions(-) 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 @@ -