Use Array.Clear instead of a loop

This commit is contained in:
Matt Nadareski
2024-11-08 11:14:00 -05:00
parent c0643e3bca
commit 5d25a017eb

View File

@@ -52,11 +52,7 @@ namespace SabreTools.Hashing.XxHash
_acc[3] = seed - XXH_PRIME32_1;
}
for (int i = 0; i < _mem32.Length; i++)
{
_mem32[i] = 0;
}
Array.Clear(_mem32, 0, _mem32.Length);
_memsize = 0;
}
@@ -151,7 +147,7 @@ namespace SabreTools.Hashing.XxHash
private static uint Round(uint acc, uint input)
{
acc += input * XXH_PRIME32_2;
acc = RotateLeft32(acc, 13);
acc = RotateLeft32(acc, 13);
acc *= XXH_PRIME32_1;
return acc;
}