From 60f90d5de7ceacff9dc342379d56ce9d3b50dc69 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 17 Jul 2023 11:33:39 +0200 Subject: [PATCH] remove redundant OR both inputs are equal here so if one of them is non ASCII, then the other one is too --- .../src/System/Text/Ascii.Equality.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Equality.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Equality.cs index a2d60599fae39..7b63ee518e060 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Equality.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Equality.cs @@ -55,7 +55,7 @@ private static bool Equals(ref TLeft left, ref TRight ri uint valueA = uint.CreateTruncating(Unsafe.Add(ref left, i)); uint valueB = uint.CreateTruncating(Unsafe.Add(ref right, i)); - if (valueA != valueB || !UnicodeUtility.IsAsciiCodePoint(valueA | valueB)) + if (valueA != valueB || !UnicodeUtility.IsAsciiCodePoint(valueA)) { return false; } @@ -108,7 +108,7 @@ private static bool Equals(ref TLeft left, ref TRight ri leftValues = TLoader.Load128(ref currentLeftSearchSpace); rightValues = Vector128.LoadUnsafe(ref currentRightSearchSpace); - if (leftValues != rightValues || !AllCharsInVectorAreAscii(leftValues | rightValues)) + if (leftValues != rightValues || !AllCharsInVectorAreAscii(leftValues)) { return false; } @@ -124,7 +124,7 @@ private static bool Equals(ref TLeft left, ref TRight ri leftValues = TLoader.Load128(ref oneVectorAwayFromLeftEnd); rightValues = Vector128.LoadUnsafe(ref oneVectorAwayFromRightEnd); - if (leftValues != rightValues || !AllCharsInVectorAreAscii(leftValues | rightValues)) + if (leftValues != rightValues || !AllCharsInVectorAreAscii(leftValues)) { return false; }