From cd323c75db63906ed691941c302a19a45280c54f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 12 May 2020 18:59:15 +0100 Subject: [PATCH] Drop masking because of explicit uint8 conversion (#5) --- deposit_contract.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deposit_contract.sol b/deposit_contract.sol index 5369024f2..003e9afdf 100644 --- a/deposit_contract.sol +++ b/deposit_contract.sol @@ -136,13 +136,13 @@ contract DepositContract is IDepositContract { function to_little_endian_64(uint64 value) internal pure returns (bytes memory ret) { // Unrolled the loop here. ret = new bytes(8); - ret[0] = bytes1(uint8(value & 0xff)); - ret[1] = bytes1(uint8((value >> 8) & 0xff)); - ret[2] = bytes1(uint8((value >> 16) & 0xff)); - ret[3] = bytes1(uint8((value >> 24) & 0xff)); - ret[4] = bytes1(uint8((value >> 32) & 0xff)); - ret[5] = bytes1(uint8((value >> 40) & 0xff)); - ret[6] = bytes1(uint8((value >> 48) & 0xff)); - ret[7] = bytes1(uint8((value >> 56) & 0xff)); + ret[0] = bytes1(uint8(value)); + ret[1] = bytes1(uint8(value >> 8)); + ret[2] = bytes1(uint8(value >> 16)); + ret[3] = bytes1(uint8(value >> 24)); + ret[4] = bytes1(uint8(value >> 32)); + ret[5] = bytes1(uint8(value >> 40)); + ret[6] = bytes1(uint8(value >> 48)); + ret[7] = bytes1(uint8(value >> 56)); } }