Skip to content

Commit ba28b85

Browse files
committed
Fixed .Min function for generic type Span
1 parent cd4efa1 commit ba28b85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Extensions/Span/SpanExtensions.Linq.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,7 @@ public static BigInteger Average(this Span<BigInteger> source)
472472
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
473473
public static T Min<T>(this Span<T> source) where T : INumber<T>
474474
{
475-
T sum = source.Sum();
476-
return sum / T.CreateChecked(source.Length);
475+
return ReadOnlySpanExtensions.Min<T>(source)
477476
}
478477
#else
479478

@@ -621,5 +620,8 @@ public static BigInteger Min(this Span<BigInteger> source)
621620
return ReadOnlySpanExtensions.Min(source);
622621
}
623622
#endif
623+
/*########################################## MAX ##########################################*/
624+
625+
624626
}
625627
}

0 commit comments

Comments
 (0)