From 56e780ba3549313c77151c3f5a9fd6f1c8597755 Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai Date: Thu, 9 Sep 2021 20:00:28 +0900 Subject: [PATCH] remove id compare , soretedview --- src/ObservableCollections/Internal/SortedView.cs | 8 +------- .../Internal/SortedViewViewComparer.cs | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/ObservableCollections/Internal/SortedView.cs b/src/ObservableCollections/Internal/SortedView.cs index 9dce18a..281446b 100644 --- a/src/ObservableCollections/Internal/SortedView.cs +++ b/src/ObservableCollections/Internal/SortedView.cs @@ -212,13 +212,7 @@ namespace ObservableCollections.Internal public int Compare((T value, TKey id) x, (T value, TKey id) y) { - var compare = comparer.Compare(x.value, y.value); - if (compare == 0) - { - compare = Comparer.Default.Compare(x.id, y.id); - } - - return compare; + return comparer.Compare(x.value, y.value); } } } diff --git a/src/ObservableCollections/Internal/SortedViewViewComparer.cs b/src/ObservableCollections/Internal/SortedViewViewComparer.cs index 3bf75b4..d5633e0 100644 --- a/src/ObservableCollections/Internal/SortedViewViewComparer.cs +++ b/src/ObservableCollections/Internal/SortedViewViewComparer.cs @@ -231,13 +231,7 @@ namespace ObservableCollections.Internal public int Compare((TView view, TKey id) x, (TView view, TKey id) y) { - var compare = comparer.Compare(x.view, y.view); - if (compare == 0) - { - compare = Comparer.Default.Compare(x.id, y.id); - } - - return compare; + return comparer.Compare(x.view, y.view); } } }