Skip to content

Commit

Permalink
refactor!: remove Span<T>.Replace for .NET 8 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Nov 14, 2023
1 parent b6b90bf commit e2327b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ TypeInitializationException.

- X10D: Removed `IEnumerable<T>.ConcatOne` - this functionality already exists with `Append`.
- X10D: Removed `Endianness` enum.
- X10D: Removed `Span<T>.Replace(T, T)` for .NET 8 target.
- X10D: Removed .NET Standard 2.1 target.
- X10D.Hosting: Removed .NET Standard 2.1 target.
- X10D.DSharpPlus: Complete sunset of library. This library will not be updated to support DSharpPlus v5.0.0 (#83).
Expand Down
2 changes: 2 additions & 0 deletions X10D/src/Collections/SpanExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static ReadOnlySpan<T> AsReadOnly<T>(this in Span<T> source)
return source;
}

#if !NET8_0_OR_GREATER
/// <summary>
/// Replaces all occurrences of a specified element in a span of elements with another specified element.
/// </summary>
Expand All @@ -72,6 +73,7 @@ public static void Replace<T>(this Span<T> haystack, T needle, T replacement) wh
}
}
}
#endif

/// <summary>
/// Splits a span of elements into sub-spans based on a delimiting element.
Expand Down

0 comments on commit e2327b5

Please sign in to comment.