@@ -3138,7 +3138,7 @@ public static int BinarySearch<T>(
3138
3138
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
3139
3139
public static int BinarySearch < T , TComparable > (
3140
3140
this Span < T > span , TComparable comparable )
3141
- where TComparable : IComparable < T >
3141
+ where TComparable : IComparable < T > , allows ref struct
3142
3142
{
3143
3143
return BinarySearch ( ( ReadOnlySpan < T > ) span , comparable ) ;
3144
3144
}
@@ -3164,7 +3164,7 @@ public static int BinarySearch<T, TComparable>(
3164
3164
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
3165
3165
public static int BinarySearch < T , TComparer > (
3166
3166
this Span < T > span , T value , TComparer comparer )
3167
- where TComparer : IComparer < T >
3167
+ where TComparer : IComparer < T > , allows ref struct
3168
3168
{
3169
3169
return BinarySearch ( ( ReadOnlySpan < T > ) span , value , comparer ) ;
3170
3170
}
@@ -3212,7 +3212,7 @@ public static int BinarySearch<T>(
3212
3212
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
3213
3213
public static int BinarySearch < T , TComparable > (
3214
3214
this ReadOnlySpan < T > span , TComparable comparable )
3215
- where TComparable : IComparable < T >
3215
+ where TComparable : IComparable < T > , allows ref struct
3216
3216
{
3217
3217
return SpanHelpers . BinarySearch ( span , comparable ) ;
3218
3218
}
@@ -3238,7 +3238,7 @@ public static int BinarySearch<T, TComparable>(
3238
3238
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
3239
3239
public static int BinarySearch < T , TComparer > (
3240
3240
this ReadOnlySpan < T > span , T value , TComparer comparer )
3241
- where TComparer : IComparer < T >
3241
+ where TComparer : IComparer < T > , allows ref struct
3242
3242
{
3243
3243
if ( comparer == null )
3244
3244
ThrowHelper . ThrowArgumentNullException ( ExceptionArgument . comparer ) ;
0 commit comments