1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-13 00:45:42 +00:00

Directly return SpanSplitEnumerator instance

This commit is contained in:
Oliver Booth 2022-11-29 16:12:16 +00:00
parent c9e473e86f
commit f0781e5564
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -64,7 +64,7 @@ public static class SpanExtensions
public static SpanSplitEnumerator<T> Split<T>(this in Span<T> source, T delimiter) public static SpanSplitEnumerator<T> Split<T>(this in Span<T> source, T delimiter)
where T : struct, IEquatable<T> where T : struct, IEquatable<T>
{ {
return source.AsReadOnly().Split(delimiter); return new SpanSplitEnumerator<T>(source, delimiter);
} }
/// <summary> /// <summary>
@ -94,7 +94,7 @@ public static class SpanExtensions
public static SpanSplitEnumerator<T> Split<T>(this in Span<T> source, in ReadOnlySpan<T> delimiter) public static SpanSplitEnumerator<T> Split<T>(this in Span<T> source, in ReadOnlySpan<T> delimiter)
where T : struct, IEquatable<T> where T : struct, IEquatable<T>
{ {
return source.AsReadOnly().Split(delimiter); return new SpanSplitEnumerator<T>(source, delimiter);
} }
/// <summary> /// <summary>