Skip to content

Commit

Permalink
Tweak EncodeToUtf16_Vector128
Browse files Browse the repository at this point in the history
  • Loading branch information
xtqqczze committed Nov 26, 2024
1 parent b4923b3 commit 750e1a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libraries/Common/src/System/HexConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,13 @@ private static void EncodeToUtf16_Vector128(ReadOnlySpan<byte> bytes, Span<char>

v0.StoreUnsafe(ref destRef, pos * 2);

pos += (nuint)Vector128<int>.Count;
if (pos == (nuint)bytes.Length)
if (pos == lengthSubVector128)
{
return;
}

pos += (nuint)Vector128<int>.Count;

// Overlap with the current chunk for trailing elements
if (pos > lengthSubVector128)
{
Expand Down

1 comment on commit 750e1a8

@xtqqczze
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.