Skip to content

Commit f8d5f54

Browse files
committed
Revert "quick."
This reverts commit 956bdd3.
1 parent 956bdd3 commit f8d5f54

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

src/Extensions/Span/SpanExtensions.Linq.cs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -221,52 +221,6 @@ public static Span<T> Take<T>(this Span<T> source, int count)
221221
return source[..count];
222222
}
223223

224-
/// <summary>
225-
/// Bypasses elements in <paramref name="source"/> as long as a <paramref name="condition"/> is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.
226-
/// </summary>
227-
/// <typeparam name="T">The type of elements in the <see cref="ReadOnlySpan{T}"/>.</typeparam>
228-
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to operate on.</param>
229-
/// <param name="condition">A function to test each element for a condition.</param>
230-
/// <returns>A <see cref="ReadOnlySpan{T}"/> that contains the elements from <paramref name="source"/> starting at the first element in the linear series that does not pass the specified <paramref name="condition" />.</returns>
231-
/// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="condition"/> is null.</exception>
232-
public static Span<T> SkipWhile<T>(this Span<T> source, Predicate<T> condition)
233-
{
234-
int count = 0;
235-
while(count < source.Length)
236-
{
237-
T t = source[count];
238-
if(!condition(t))
239-
{
240-
return source.Skip(count);
241-
}
242-
count++;
243-
}
244-
return Span<T>.Empty;
245-
}
246-
247-
/// <summary>
248-
/// Returns elements from <paramref name="source"/> as long as a specified <paramref name="condition"/> is true, and then skips the remaining elements.
249-
/// </summary>
250-
/// <typeparam name="T">The type of elements in the <see cref="ReadOnlySpan{T}"/>.</typeparam>
251-
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to operate on.</param>
252-
/// <param name="condition">A function to test each element for a condition.</param>
253-
/// <returns>A <see cref="ReadOnlySpan{T}"/> that contains elements from <paramref name="source"/> that occur before the element at which the <paramref name="condition"/> no longer passes.</returns>
254-
/// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="condition"/> is null.</exception>
255-
public static Span<T> TakeWhile<T>(this Span<T> source, Predicate<T> condition)
256-
{
257-
int count = 0;
258-
while(count < source.Length)
259-
{
260-
T t = source[count];
261-
if(!condition(t))
262-
{
263-
return source.Take(count);
264-
}
265-
count++;
266-
}
267-
return Span<T>.Empty;
268-
}
269-
270224
/// <summary>
271225
/// Returns a new <see cref="Span{T}"/> that contains the elements from source with the last <paramref name="count"/> elements of the source collection omitted.
272226
/// </summary>

0 commit comments

Comments
 (0)