solidity/test/libsolidity/semanticTests/inlineAssembly/keccak256_optimization.sol
2022-05-19 20:23:28 +02:00

16 lines
326 B
Solidity

contract C {
function f() public view returns (bool ret) {
assembly {
let x := calldataload(0)
mstore(0, x)
mstore(0x20, x)
let a := keccak256(0, 4)
let b := keccak256(0x20, 4)
ret := eq(a, b)
}
}
}
// ====
// ----
// f() -> true