Skip to content

Commit 4321d8a

Browse files
committed
Fix Several MemoryExtensions.LastIndexOfAnyExcept overloads incorrectly document "first occurrence" - dotnet/runtime#136282
1 parent 136046f commit 4321d8a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/System/CompatMemoryExtensions.LT10.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static int LastIndexOfAnyExceptComparer(ReadOnlySpan<T> span, T value0, T value1
617617
/// <param name="values">The values to avoid.</param>
618618
/// <param name="comparer">The <see cref="IEqualityComparer{T}"/> implementation to use when comparing elements, or <see langword="null"/> to use the default <see cref="IEqualityComparer{T}"/> for the type of an element.</param>
619619
/// <returns>
620-
/// The index in the span of the first occurrence of any value other than those in <paramref name="values"/>.
620+
/// The index in the span of the last occurrence of any value other than those in <paramref name="values"/>.
621621
/// If all of the values are in <paramref name="values"/>, returns -1.
622622
/// </returns>
623623
public static int LastIndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values, IEqualityComparer<T>? comparer = null)

‎src/System/CompatMemoryExtensions.LT7.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
506506
/// <param name="span">The span to search.</param>
507507
/// <param name="values">The values to avoid.</param>
508508
/// <returns>
509-
/// The index in the span of the first occurrence of any value other than those in <paramref name="values"/>.
509+
/// The index in the span of the last occurrence of any value other than those in <paramref name="values"/>.
510510
/// If all of the values are in <paramref name="values"/>, returns -1.
511511
/// </returns>
512512
public static unsafe int LastIndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>?

0 commit comments

Comments
 (0)