Skip to content

Commit 7fc205a

Browse files
committed
readded Count to .Net 8.
1 parent 3ee851d commit 7fc205a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Extensions/ReadOnlySpan/Linq/Count.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ namespace SpanExtensions
44
{
55
public static partial class ReadOnlySpanExtensions
66
{
7-
#if !NET8_0_OR_GREATER // support for this method has been added in .Net 8. Just include it for backward-compatibility.
8-
97
/// <summary>
108
/// Returns the number of elements in a <see cref="ReadOnlySpan{T}"/>.
119
/// </summary>
@@ -17,7 +15,7 @@ public static int Count<T>(this ReadOnlySpan<T> source)
1715
{
1816
return source.Length;
1917
}
20-
#endif
18+
2119
/// <summary>
2220
/// Returns a number that represents how many elements in the specified sequence satisfy a condition.
2321
/// </summary>

src/Extensions/Span/Linq/Count.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ namespace SpanExtensions
44
{
55
public static partial class SpanExtensions
66
{
7-
#if !NET8_0_OR_GREATER // support for this method has been added in .Net 8. Just include it for backward-compatibility.
87
/// <summary>
98
/// Returns the number of elements in a <see cref="Span{T}"/>.
109
/// </summary>
@@ -16,7 +15,7 @@ public static int Count<T>(this Span<T> source)
1615
{
1716
return ReadOnlySpanExtensions.Count<T>(source);
1817
}
19-
#endif
18+
2019
/// <summary>
2120
/// Returns a number that represents how many elements in the specified sequence satisfy a condition.
2221
/// </summary>

0 commit comments

Comments
 (0)