2020-03-09 21:14:07 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2020-10-20 15:05:58 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// test1() -> true
|
2021-05-05 06:35:17 +00:00
|
|
|
// gas irOptimized: 527479
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 613377
|
2021-03-11 11:17:50 +00:00
|
|
|
// gas legacyOptimized: 606411
|