Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0] Use System.Numerics.IEqualityOperators.op_Equality in SpanHelper.T.cs where possible. #74738

Merged
merged 2 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ public static IEnumerable<object[]> IndexOf_U_WithDiaeresis_TestData()
[MemberData(nameof(IndexOf_TestData))]
[MemberData(nameof(IndexOf_Aesc_Ligature_TestData))]
[MemberData(nameof(IndexOf_U_WithDiaeresis_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/74179", TestRuntimes.Mono)]
public void IndexOf_String(CompareInfo compareInfo, string source, string value, int startIndex, int count, CompareOptions options, int expected, int expectedMatchLength)
{
if (value.Length == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ private static StringComparison GetStringComparison(CompareOptions options)

[ConditionalTheory(nameof(PredefinedCulturesOnlyIsDisabled))]
[MemberData(nameof(IndexOf_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/74179", TestRuntimes.Mono)]
public void TestIndexOf(string source, string value, int startIndex, int count, CompareOptions options, int result)
{
foreach (string cul in s_cultureNames)
Expand Down Expand Up @@ -912,7 +911,6 @@ static void TestCore(CompareInfo compareInfo, string source, string value, int s

[ConditionalTheory(nameof(PredefinedCulturesOnlyIsDisabled))]
[MemberData(nameof(LastIndexOf_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/74179", TestRuntimes.Mono)]
public void TestLastIndexOf(string source, string value, int startIndex, int count, CompareOptions options, int result)
{
foreach (string cul in s_cultureNames)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ private static int IndexOfValueType<TValue, TNegator>(ref TValue searchSpace, TV
{
length -= 1;

if (TNegator.NegateIfNeeded(Unsafe.Add(ref searchSpace, offset).Equals(value))) return (int)offset;
if (TNegator.NegateIfNeeded(Unsafe.Add(ref searchSpace, offset) == value)) return (int)offset;

offset += 1;
}
Expand Down Expand Up @@ -2145,7 +2145,7 @@ private static int LastIndexOfValueType<TValue, TNegator>(ref TValue searchSpace
{
length -= 1;

if (TNegator.NegateIfNeeded(Unsafe.Add(ref searchSpace, offset).Equals(value))) return (int)offset;
if (TNegator.NegateIfNeeded(Unsafe.Add(ref searchSpace, offset) == value)) return (int)offset;

offset -= 1;
}
Expand Down