-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Memory
Milestone
Description
Proposal:
public static class MemoryExtensions {
bool Contains<T>(this Span<T> span, T value);
bool Contains<T>(this ReadOnlySpan<T> span, T value);
bool Contains<T>(this Span<T> span, T value, IEqualityComparer<T> comparer);
bool Contains<T>(this ReadOnlySpan<T> span, T value, IEqualityComparer<T> comparer);
}
This is different from the IndexOf
method in that we can perform certain optimizations if we know you don't need the exact index of where the value was found. There are a few places in the framework that would benefit from this.
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Memory