use Binary.RotByteL method where appropriate.

This commit is contained in:
morkt 2015-12-06 22:28:13 +04:00
parent fd18f21b40
commit 2dae9872ef

View File

@ -137,7 +137,7 @@ namespace GameRes.Formats.FC01
while (length > 0) while (length > 0)
{ {
var v = data[index]; var v = data[index];
data[index++] = (byte)((v << 1 | v >> 7) ^ key); data[index++] = (byte)(Binary.RotByteL (v, 1) ^ key);
key += length--; key += length--;
} }
} }
@ -339,7 +339,7 @@ namespace GameRes.Formats.FC01
byte c = m_input[m_src++]; byte c = m_input[m_src++];
if (0 != Key) if (0 != Key)
{ {
c = (byte)(((c << 1) | (c >> 7)) ^ key); c = (byte)(Binary.RotByteL (c, 1) ^ key);
key -= (byte)i; key -= (byte)i;
} }
word_10036650[i*2] = d; word_10036650[i*2] = d;