Skip to content

Commit

Permalink
bug fix attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruihan-Yin committed Mar 18, 2024
1 parent ded022e commit 1d20ede
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ internal unsafe int GetNonRandomizedHashCode()
// a very wide net because it will change, e.g., '^' to '~'. But that should
// be ok because we expect this to be very rare in practice.

if(Vector128.IsHardwareAccelerated && length >= Vector128<ushort>.Count)
if(Vector128.IsHardwareAccelerated && length >= 2 * Vector128<ushort>.Count)
{
Vector128<uint> hashVector = Vector128.Create(hash1);

Expand Down Expand Up @@ -912,7 +912,7 @@ internal unsafe int GetNonRandomizedHashCodeOrdinalIgnoreCase()
// be ok because we expect this to be very rare in practice.
const uint NormalizeToLowercase = 0x0020_0020u; // valid both for big-endian and for little-endian

if(Vector128.IsHardwareAccelerated && length >= Vector128<ushort>.Count)
if(Vector128.IsHardwareAccelerated && length >= 2 * Vector128<ushort>.Count)
{
Vector128<uint> hashVector = Vector128.Create(hash1);
Vector128<uint> NormalizeToLowercaseVec = Vector128.Create(NormalizeToLowercase);
Expand Down

0 comments on commit 1d20ede

Please sign in to comment.