Skip to content

Commit

Permalink
correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Nuon committed Mar 9, 2024
1 parent 7ae0283 commit 3f6e5ef
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions test/UTF8ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,6 @@ public class Utf8SIMDValidationTests
static int[] outputLengths = { 128, 256,345, 512,968, 1024, 1000 }; // Example lengths


public static void ShiftLeft<T>(T[] array, int shiftAmount)
{
int length = array.Length;
if (length == 0 || shiftAmount % length == 0) return; // No need to shift
T[] copy = new T[length];
Array.Copy(array, copy, length);

for (int i = 0; i < length; i++)
{
int newIndex = (i + length - shiftAmount % length) % length;
array[newIndex] = copy[i];
}
}

public static void ShiftRight<T>(T[] array, int shiftAmount)
{
int length = array.Length;
if (length == 0 || shiftAmount % length == 0) return; // No need to shift
T[] copy = new T[length];
Array.Copy(array, copy, length);

for (int i = 0; i < length; i++)
{
int newIndex = (i + shiftAmount) % length;
array[newIndex] = copy[i];
}
}




Expand Down

0 comments on commit 3f6e5ef

Please sign in to comment.