From aee0784acfc07d1156332b4315c882fe1e752b2d Mon Sep 17 00:00:00 2001 From: neuecc Date: Fri, 10 Sep 2021 16:19:57 +0900 Subject: [PATCH] remove IComparable constraint --- .../ObservableCollections/Runtime/IObservableCollection.cs | 6 +++--- .../ObservableCollections/Runtime/Internal/SortedView.cs | 2 +- .../Runtime/Internal/SortedViewViewComparer.cs | 2 +- src/ObservableCollections/IObservableCollection.cs | 6 +++--- src/ObservableCollections/Internal/SortedView.cs | 2 +- .../Internal/SortedViewViewComparer.cs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/IObservableCollection.cs b/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/IObservableCollection.cs index 572fcdb..8389311 100644 --- a/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/IObservableCollection.cs +++ b/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/IObservableCollection.cs @@ -51,19 +51,19 @@ namespace ObservableCollections public static class ObservableCollectionsExtensions { public static ISynchronizedView CreateSortedView(this IObservableCollection source, Func identitySelector, Func transform, IComparer comparer) - where TKey : IComparable + { return new SortedView(source, identitySelector, transform, comparer); } public static ISynchronizedView CreateSortedView(this IObservableCollection source, Func identitySelector, Func transform, IComparer viewComparer) - where TKey : IComparable + { return new SortedViewViewComparer(source, identitySelector, transform, viewComparer); } public static ISynchronizedView CreateSortedView(this IObservableCollection source, Func identitySelector, Func transform, Func compareSelector, bool ascending = true) - where TKey : IComparable + { return source.CreateSortedView(identitySelector, transform, new AnonymousComparer(compareSelector, ascending)); } diff --git a/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedView.cs b/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedView.cs index 13e6266..d0ca75c 100644 --- a/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedView.cs +++ b/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedView.cs @@ -7,7 +7,7 @@ using System.Linq; namespace ObservableCollections.Internal { internal class SortedView : ISynchronizedView - where TKey : IComparable + { readonly IObservableCollection source; readonly Func transform; diff --git a/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedViewViewComparer.cs b/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedViewViewComparer.cs index 70ec618..c543490 100644 --- a/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedViewViewComparer.cs +++ b/src/ObservableCollections.Unity/Assets/Plugins/ObservableCollections/Runtime/Internal/SortedViewViewComparer.cs @@ -7,7 +7,7 @@ using System.Linq; namespace ObservableCollections.Internal { internal class SortedViewViewComparer : ISynchronizedView - where TKey : IComparable + { readonly IObservableCollection source; readonly Func transform; diff --git a/src/ObservableCollections/IObservableCollection.cs b/src/ObservableCollections/IObservableCollection.cs index 47845ba..ef21cac 100644 --- a/src/ObservableCollections/IObservableCollection.cs +++ b/src/ObservableCollections/IObservableCollection.cs @@ -51,19 +51,19 @@ namespace ObservableCollections public static class ObservableCollectionsExtensions { public static ISynchronizedView CreateSortedView(this IObservableCollection source, Func identitySelector, Func transform, IComparer comparer) - where TKey : notnull, IComparable + where TKey : notnull { return new SortedView(source, identitySelector, transform, comparer); } public static ISynchronizedView CreateSortedView(this IObservableCollection source, Func identitySelector, Func transform, IComparer viewComparer) - where TKey : notnull, IComparable + where TKey : notnull { return new SortedViewViewComparer(source, identitySelector, transform, viewComparer); } public static ISynchronizedView CreateSortedView(this IObservableCollection source, Func identitySelector, Func transform, Func compareSelector, bool ascending = true) - where TKey : notnull, IComparable + where TKey : notnull { return source.CreateSortedView(identitySelector, transform, new AnonymousComparer(compareSelector, ascending)); } diff --git a/src/ObservableCollections/Internal/SortedView.cs b/src/ObservableCollections/Internal/SortedView.cs index c3fb30e..9dce18a 100644 --- a/src/ObservableCollections/Internal/SortedView.cs +++ b/src/ObservableCollections/Internal/SortedView.cs @@ -7,7 +7,7 @@ using System.Linq; namespace ObservableCollections.Internal { internal class SortedView : ISynchronizedView - where TKey : notnull, IComparable + where TKey : notnull { readonly IObservableCollection source; readonly Func transform; diff --git a/src/ObservableCollections/Internal/SortedViewViewComparer.cs b/src/ObservableCollections/Internal/SortedViewViewComparer.cs index 81644d8..3bf75b4 100644 --- a/src/ObservableCollections/Internal/SortedViewViewComparer.cs +++ b/src/ObservableCollections/Internal/SortedViewViewComparer.cs @@ -7,7 +7,7 @@ using System.Linq; namespace ObservableCollections.Internal { internal class SortedViewViewComparer : ISynchronizedView - where TKey : notnull, IComparable + where TKey : notnull { readonly IObservableCollection source; readonly Func transform;