2020-11-12 14:29:08 +00:00
|
|
|
contract c {
|
|
|
|
uint[20] spacer;
|
|
|
|
uint[] dynamic;
|
|
|
|
function fill() public {
|
|
|
|
for (uint i = 0; i < 21; ++i)
|
|
|
|
dynamic.push(i + 1);
|
|
|
|
}
|
|
|
|
function halfClear() public {
|
|
|
|
while (dynamic.length > 5)
|
|
|
|
dynamic.pop();
|
|
|
|
}
|
|
|
|
function fullClear() public { delete dynamic; }
|
|
|
|
}
|
|
|
|
// ----
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 1
|
2020-11-12 14:29:08 +00:00
|
|
|
// fill() ->
|
2022-05-23 10:54:18 +00:00
|
|
|
// gas irOptimized: 519616
|
2022-03-07 18:13:35 +00:00
|
|
|
// gas legacy: 521710
|
|
|
|
// gas legacyOptimized: 516922
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 0
|
2020-11-12 14:29:08 +00:00
|
|
|
// halfClear() ->
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 0
|
2020-11-12 14:29:08 +00:00
|
|
|
// fullClear() ->
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 1
|