Skip to content

Commit 7e43851

Browse files
committed
code
1 parent 66ff9a8 commit 7e43851

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/Extensions/ReadOnlySpan/ReadOnlySpanExtensions.Linq.cs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static bool Any<T>(this ReadOnlySpan<T> source, Predicate<T> predicate) w
4747
}
4848
return false;
4949
}
50+
5051
#if NET7_0_OR_GREATER
5152

5253
/// <summary>
@@ -65,7 +66,9 @@ public static T Sum<T>(this ReadOnlySpan<T> source) where T : INumber<T>
6566
}
6667
return number;
6768
}
68-
#else #if NET5_0_OR_GREATER
69+
#else
70+
71+
#if NET5_0_OR_GREATER
6972

7073
/// <summary>
7174
/// Computes the Sum of all the elements in <paramref name="source"/>.
@@ -82,6 +85,7 @@ public static Half Sum(this ReadOnlySpan<Half> source)
8285
}
8386
return (Half)number;
8487
}
88+
8589
#endif
8690

8791
/// <summary>
@@ -415,6 +419,7 @@ public static Half Average(this ReadOnlySpan<Half> source)
415419
return (Half)((float)sum / source.Length);
416420
}
417421
#endif
422+
418423
/// <summary>
419424
/// Computes the Average of all the values in <paramref name="source"/>.
420425
/// </summary>
@@ -853,7 +858,7 @@ public static BigInteger Min(this ReadOnlySpan<BigInteger> source)
853858
/// Computes the Max of all the values in <paramref name="source"/>.
854859
/// </summary>
855860
/// <typeparam name="T">The type of elements in the <see cref="ReadOnlySpan{T}"/>.</typeparam>
856-
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to operate on.</param>
861+
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to operate on.</param>
857862
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
858863
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
859864
public static T Max<T>(this ReadOnlySpan<T> source) where T : INumber<T>
@@ -876,7 +881,7 @@ public static T Max<T>(this ReadOnlySpan<T> source) where T : INumber<T>
876881
/// <summary>
877882
/// Computes the Max of all the values in <paramref name="source"/>.
878883
/// </summary>
879-
/// <param name="source">The <see cref="ReadOnlySpan{Half}"/> to operate on.</param>
884+
/// <param name="source">The <see cref="ReadOnlySpan{Half}"/> to operate on.</param>
880885
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
881886
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
882887
public static Half Max(this ReadOnlySpan<Half> source)
@@ -897,7 +902,7 @@ public static Half Max(this ReadOnlySpan<Half> source)
897902
/// <summary>
898903
/// Computes the Max of all the values in <paramref name="source"/>.
899904
/// </summary>
900-
/// <param name="source">The <see cref="ReadOnlySpan{Byte}"/> to operate on.</param>
905+
/// <param name="source">The <see cref="ReadOnlySpan{Byte}"/> to operate on.</param>
901906
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
902907
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
903908
public static byte Max(this ReadOnlySpan<byte> source)
@@ -917,7 +922,7 @@ public static byte Max(this ReadOnlySpan<byte> source)
917922
/// <summary>
918923
/// Computes the Max of all the values in <paramref name="source"/>.
919924
/// </summary>
920-
/// <param name="source">The <see cref="ReadOnlySpan{UInt16}"/> to operate on.</param>
925+
/// <param name="source">The <see cref="ReadOnlySpan{UInt16}"/> to operate on.</param>
921926
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
922927
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
923928
public static ushort Max(this ReadOnlySpan<ushort> source)
@@ -937,7 +942,7 @@ public static ushort Max(this ReadOnlySpan<ushort> source)
937942
/// <summary>
938943
/// Computes the Max of all the values in <paramref name="source"/>.
939944
/// </summary>
940-
/// <param name="source">The <see cref="ReadOnlySpan{uint32}"/> to operate on.</param>
945+
/// <param name="source">The <see cref="ReadOnlySpan{uint32}"/> to operate on.</param>
941946
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
942947
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
943948
public static uint Max(this ReadOnlySpan<uint> source)
@@ -957,7 +962,7 @@ public static uint Max(this ReadOnlySpan<uint> source)
957962
/// <summary>
958963
/// Computes the Max of all the values in <paramref name="source"/>.
959964
/// </summary>
960-
/// <param name="source">The <see cref="ReadOnlySpan{UInt64}"/> to operate on.</param>
965+
/// <param name="source">The <see cref="ReadOnlySpan{UInt64}"/> to operate on.</param>
961966
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
962967
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
963968
public static ulong Max(this ReadOnlySpan<ulong> source)
@@ -977,7 +982,7 @@ public static ulong Max(this ReadOnlySpan<ulong> source)
977982
/// <summary>
978983
/// Computes the Max of all the values in <paramref name="source"/>.
979984
/// </summary>
980-
/// <param name="source">The <see cref="ReadOnlySpan{SByte}"/> to operate on.</param>
985+
/// <param name="source">The <see cref="ReadOnlySpan{SByte}"/> to operate on.</param>
981986
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
982987
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
983988
public static sbyte Max(this ReadOnlySpan<sbyte> source)
@@ -997,7 +1002,7 @@ public static sbyte Max(this ReadOnlySpan<sbyte> source)
9971002
/// <summary>
9981003
/// Computes the Max of all the values in <paramref name="source"/>.
9991004
/// </summary>
1000-
/// <param name="source">The <see cref="ReadOnlySpan{Int16}"/> to operate on.</param>
1005+
/// <param name="source">The <see cref="ReadOnlySpan{Int16}"/> to operate on.</param>
10011006
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
10021007
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
10031008
public static short Max(this ReadOnlySpan<short> source)
@@ -1017,7 +1022,7 @@ public static short Max(this ReadOnlySpan<short> source)
10171022
/// <summary>
10181023
/// Computes the Max of all the values in <paramref name="source"/>.
10191024
/// </summary>
1020-
/// <param name="source">The <see cref="ReadOnlySpan{Int32}"/> to operate on.</param>
1025+
/// <param name="source">The <see cref="ReadOnlySpan{Int32}"/> to operate on.</param>
10211026
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
10221027
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
10231028
public static int Max(this ReadOnlySpan<int> source)
@@ -1037,7 +1042,7 @@ public static int Max(this ReadOnlySpan<int> source)
10371042
/// <summary>
10381043
/// Computes the Max of all the values in <paramref name="source"/>.
10391044
/// </summary>
1040-
/// <param name="source">The <see cref="ReadOnlySpan{Int64}"/> to operate on.</param>
1045+
/// <param name="source">The <see cref="ReadOnlySpan{Int64}"/> to operate on.</param>
10411046
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
10421047
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
10431048
public static long Max(this ReadOnlySpan<long> source)
@@ -1057,7 +1062,7 @@ public static long Max(this ReadOnlySpan<long> source)
10571062
/// <summary>
10581063
/// Computes the Max of all the values in <paramref name="source"/>.
10591064
/// </summary>
1060-
/// <param name="source">The <see cref="ReadOnlySpan{Single}"/> to operate on.</param>
1065+
/// <param name="source">The <see cref="ReadOnlySpan{Single}"/> to operate on.</param>
10611066
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
10621067
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
10631068
public static float Max(this ReadOnlySpan<float> source)
@@ -1077,7 +1082,7 @@ public static float Max(this ReadOnlySpan<float> source)
10771082
/// <summary>
10781083
/// Computes the Max of all the values in <paramref name="source"/>.
10791084
/// </summary>
1080-
/// <param name="source">The <see cref="ReadOnlySpan{Double}"/> to operate on.</param>
1085+
/// <param name="source">The <see cref="ReadOnlySpan{Double}"/> to operate on.</param>
10811086
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
10821087
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
10831088
public static double Max(this ReadOnlySpan<double> source)
@@ -1097,7 +1102,7 @@ public static double Max(this ReadOnlySpan<double> source)
10971102
/// <summary>
10981103
/// Computes the Max of all the values in <paramref name="source"/>.
10991104
/// </summary>
1100-
/// <param name="source">The <see cref="ReadOnlySpan{Int64}"/> to operate on.</param>
1105+
/// <param name="source">The <see cref="ReadOnlySpan{Int64}"/> to operate on.</param>
11011106
/// <returns>The Max out of all the values in <paramref name="source"/>.</returns>
11021107
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
11031108
public static decimal Max(this ReadOnlySpan<decimal> source)
@@ -1134,6 +1139,5 @@ public static BigInteger Max(this ReadOnlySpan<BigInteger> source)
11341139
return max;
11351140
}
11361141
#endif
1137-
11381142
}
11391143
}

0 commit comments

Comments
 (0)