Another Flake optimization

This commit is contained in:
Grigory Chudov
2013-03-26 19:50:44 -04:00
parent 55af6e181a
commit 76111a5c6e
4 changed files with 55 additions and 13 deletions

View File

@@ -17,8 +17,10 @@ namespace CUETools.Codecs
public static unsafe ushort ComputeChecksum(ushort crc, byte* bytes, int count)
{
fixed (ushort* t = table)
for (int i = count; i > 0; i--)
crc = (ushort)((crc << 8) ^ t[(crc >> 8) ^ *(bytes++)]);
for (int i = count; i > 0; i--)
{
crc = (ushort)((crc << 8) ^ t[(crc >> 8) ^ *(bytes++)]);
}
return crc;
}