1313**
1414===========================================================*/
1515
16+ #nullable enable
1617using System . Diagnostics ;
1718using System . Runtime . CompilerServices ;
1819
@@ -38,7 +39,7 @@ internal static int FloorLog2PlusOne(int n)
3839 return result ;
3940 }
4041
41- internal static void ThrowOrIgnoreBadComparer ( object comparer )
42+ internal static void ThrowOrIgnoreBadComparer ( object ? comparer )
4243 {
4344 throw new ArgumentException ( SR . Format ( SR . Arg_BogusIComparer , comparer ) ) ;
4445 }
@@ -48,7 +49,7 @@ internal partial class ArraySortHelper<T>
4849 {
4950 #region IArraySortHelper<T> Members
5051
51- public void Sort ( T [ ] keys , int index , int length , IComparer < T > comparer )
52+ public void Sort ( T [ ] keys , int index , int length , IComparer < T > ? comparer )
5253 {
5354 Debug . Assert ( keys != null , "Check the arguments in the caller!" ) ;
5455 Debug . Assert ( index >= 0 && length >= 0 && ( keys . Length - index >= length ) , "Check the arguments in the caller!" ) ;
@@ -74,7 +75,7 @@ public void Sort(T[] keys, int index, int length, IComparer<T> comparer)
7475 }
7576 }
7677
77- public int BinarySearch ( T [ ] array , int index , int length , T value , IComparer < T > comparer )
78+ public int BinarySearch ( T [ ] array , int index , int length , T value , IComparer < T > ? comparer )
7879 {
7980 try
8081 {
@@ -335,7 +336,7 @@ internal partial class GenericArraySortHelper<T>
335336
336337 #region IArraySortHelper<T> Members
337338
338- public void Sort ( T [ ] keys , int index , int length , IComparer < T > comparer )
339+ public void Sort ( T [ ] keys , int index , int length , IComparer < T > ? comparer )
339340 {
340341 Debug . Assert ( keys != null , "Check the arguments in the caller!" ) ;
341342 Debug . Assert ( index >= 0 && length >= 0 && ( keys . Length - index >= length ) , "Check the arguments in the caller!" ) ;
@@ -361,7 +362,7 @@ public void Sort(T[] keys, int index, int length, IComparer<T> comparer)
361362 }
362363 }
363364
364- public int BinarySearch ( T [ ] array , int index , int length , T value , IComparer < T > comparer )
365+ public int BinarySearch ( T [ ] array , int index , int length , T value , IComparer < T > ? comparer )
365366 {
366367 Debug . Assert ( array != null , "Check the arguments in the caller!" ) ;
367368 Debug . Assert ( index >= 0 && length >= 0 && ( array . Length - index >= length ) , "Check the arguments in the caller!" ) ;
@@ -624,7 +625,7 @@ private static void InsertionSort(T[] keys, int lo, int hi)
624625
625626 internal partial class ArraySortHelper < TKey , TValue >
626627 {
627- public void Sort ( TKey [ ] keys , TValue [ ] values , int index , int length , IComparer < TKey > comparer )
628+ public void Sort ( TKey [ ] keys , TValue [ ] values , int index , int length , IComparer < TKey > ? comparer )
628629 {
629630 Debug . Assert ( keys != null , "Check the arguments in the caller!" ) ; // Precondition on interface method
630631 Debug . Assert ( values != null , "Check the arguments in the caller!" ) ;
@@ -871,7 +872,7 @@ private static void InsertionSort(TKey[] keys, TValue[] values, int lo, int hi,
871872 internal partial class GenericArraySortHelper < TKey , TValue >
872873 where TKey : IComparable < TKey >
873874 {
874- public void Sort ( TKey [ ] keys , TValue [ ] values , int index , int length , IComparer < TKey > comparer )
875+ public void Sort ( TKey [ ] keys , TValue [ ] values , int index , int length , IComparer < TKey > ? comparer )
875876 {
876877 Debug . Assert ( keys != null , "Check the arguments in the caller!" ) ;
877878 Debug . Assert ( index >= 0 && length >= 0 && ( keys . Length - index >= length ) , "Check the arguments in the caller!" ) ;
0 commit comments