Skip to content

Commit 8171bd0

Browse files
authored
Add IndexOfAnyValues (#78093)
* Add IndexOfAnyValues * Remove IAsciiSet special cases * More tests * Move expensive tests back to OuterLoop * Tweak scalar paths * Improve IndexOfAnyValues<T> summary * Add temporary MONO workaround * Simplify IndexOfAny{1, 2, 3}Values * Remove redundant AND before shift
1 parent 5005b60 commit 8171bd0

30 files changed

+2572
-639
lines changed

src/libraries/System.Memory/ref/System.Memory.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,23 @@ public static void CopyTo<T>(this T[]? source, System.Span<T> destination) { }
243243
public static System.Text.SpanRuneEnumerator EnumerateRunes(this System.Span<char> span) { throw null; }
244244
public static bool Equals(this System.ReadOnlySpan<char> span, System.ReadOnlySpan<char> other, System.StringComparison comparisonType) { throw null; }
245245
public static int IndexOf(this System.ReadOnlySpan<char> span, System.ReadOnlySpan<char> value, System.StringComparison comparisonType) { throw null; }
246+
public static int IndexOfAny<T>(this System.ReadOnlySpan<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
246247
public static int IndexOfAny<T>(this System.ReadOnlySpan<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
247248
public static int IndexOfAny<T>(this System.ReadOnlySpan<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
248249
public static int IndexOfAny<T>(this System.ReadOnlySpan<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
250+
public static int IndexOfAny<T>(this System.Span<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
249251
public static int IndexOfAny<T>(this System.Span<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
250252
public static int IndexOfAny<T>(this System.Span<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
251253
public static int IndexOfAny<T>(this System.Span<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
252254
public static int IndexOfAnyExcept<T>(this System.Span<T> span, T value) where T : System.IEquatable<T>? { throw null; }
253255
public static int IndexOfAnyExcept<T>(this System.Span<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
254256
public static int IndexOfAnyExcept<T>(this System.Span<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
257+
public static int IndexOfAnyExcept<T>(this System.Span<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
255258
public static int IndexOfAnyExcept<T>(this System.Span<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
256259
public static int IndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, T value) where T : System.IEquatable<T>? { throw null; }
257260
public static int IndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
258261
public static int IndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
262+
public static int IndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
259263
public static int IndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
260264
public static int IndexOfAnyExceptInRange<T>(this System.ReadOnlySpan<T> span, T lowInclusive, T highInclusive) where T : System.IComparable<T> { throw null; }
261265
public static int IndexOfAnyExceptInRange<T>(this System.Span<T> span, T lowInclusive, T highInclusive) where T : System.IComparable<T> { throw null; }
@@ -267,19 +271,23 @@ public static void CopyTo<T>(this T[]? source, System.Span<T> destination) { }
267271
public static int IndexOfAnyInRange<T>(this System.Span<T> span, T lowInclusive, T highInclusive) where T : System.IComparable<T> { throw null; }
268272
public static bool IsWhiteSpace(this System.ReadOnlySpan<char> span) { throw null; }
269273
public static int LastIndexOf(this System.ReadOnlySpan<char> span, System.ReadOnlySpan<char> value, System.StringComparison comparisonType) { throw null; }
274+
public static int LastIndexOfAny<T>(this System.ReadOnlySpan<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
270275
public static int LastIndexOfAny<T>(this System.ReadOnlySpan<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
271276
public static int LastIndexOfAny<T>(this System.ReadOnlySpan<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
272277
public static int LastIndexOfAny<T>(this System.ReadOnlySpan<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
278+
public static int LastIndexOfAny<T>(this System.Span<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
273279
public static int LastIndexOfAny<T>(this System.Span<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
274280
public static int LastIndexOfAny<T>(this System.Span<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
275281
public static int LastIndexOfAny<T>(this System.Span<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
276282
public static int LastIndexOfAnyExcept<T>(this System.Span<T> span, T value) where T : System.IEquatable<T>? { throw null; }
277283
public static int LastIndexOfAnyExcept<T>(this System.Span<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
278284
public static int LastIndexOfAnyExcept<T>(this System.Span<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
285+
public static int LastIndexOfAnyExcept<T>(this System.Span<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
279286
public static int LastIndexOfAnyExcept<T>(this System.Span<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
280287
public static int LastIndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, T value) where T : System.IEquatable<T>? { throw null; }
281288
public static int LastIndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, T value0, T value1) where T : System.IEquatable<T>? { throw null; }
282289
public static int LastIndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, T value0, T value1, T value2) where T : System.IEquatable<T>? { throw null; }
290+
public static int LastIndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, System.Buffers.IndexOfAnyValues<T> values) where T : System.IEquatable<T>? { throw null; }
283291
public static int LastIndexOfAnyExcept<T>(this System.ReadOnlySpan<T> span, System.ReadOnlySpan<T> values) where T : System.IEquatable<T>? { throw null; }
284292
public static int LastIndexOfAnyExceptInRange<T>(this System.ReadOnlySpan<T> span, T lowInclusive, T highInclusive) where T : System.IComparable<T> { throw null; }
285293
public static int LastIndexOfAnyExceptInRange<T>(this System.Span<T> span, T lowInclusive, T highInclusive) where T : System.IComparable<T> { throw null; }

0 commit comments

Comments
 (0)