mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
22 lines
521 B
Solidity
22 lines
521 B
Solidity
contract c {
|
|
bytes data;
|
|
|
|
function test1() external returns (bool) {
|
|
data = new bytes(100);
|
|
for (uint256 i = 0; i < data.length; i++) data[i] = bytes1(uint8(i));
|
|
delete data[94];
|
|
delete data[96];
|
|
delete data[98];
|
|
return
|
|
data[94] == 0 &&
|
|
uint8(data[95]) == 95 &&
|
|
data[96] == 0 &&
|
|
uint8(data[97]) == 97;
|
|
}
|
|
}
|
|
// ----
|
|
// test1() -> true
|
|
// gas irOptimized: 206428
|
|
// gas legacy: 254905
|
|
// gas legacyOptimized: 247415
|