REFACTOR: Add parentheses to avoid non-obvious precedence.

This commit is contained in:
2017-12-20 17:38:12 +00:00
parent 35dec4dad3
commit 3c843c3b06
8 changed files with 25 additions and 25 deletions

View File

@@ -148,7 +148,7 @@ namespace DiscImageChef.Checksums
}
for(int i = 0; i < fileStream.Length; i++)
localhashInt = (ushort)((localhashInt >> 8) ^ localTable[fileStream.ReadByte() ^ localhashInt & 0xff]);
localhashInt = (ushort)((localhashInt >> 8) ^ localTable[fileStream.ReadByte() ^ (localhashInt & 0xff)]);
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
hash = BigEndianBitConverter.GetBytes(localhashInt);
@@ -200,7 +200,7 @@ namespace DiscImageChef.Checksums
}
for(int i = 0; i < len; i++)
localhashInt = (ushort)((localhashInt >> 8) ^ localTable[data[i] ^ localhashInt & 0xff]);
localhashInt = (ushort)((localhashInt >> 8) ^ localTable[data[i] ^ (localhashInt & 0xff)]);
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
hash = BigEndianBitConverter.GetBytes(localhashInt);