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() ->
|
2023-08-04 10:27:18 +00:00
|
|
|
// gas irOptimized: 519266
|
2023-04-26 11:03:17 +00:00
|
|
|
// gas legacy: 521414
|
|
|
|
// gas legacyOptimized: 516983
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 0
|
2020-11-12 14:29:08 +00:00
|
|
|
// halfClear() ->
|
2022-11-08 16:07:36 +00:00
|
|
|
// gas irOptimized: 113961
|
|
|
|
// gas legacy: 113257
|
|
|
|
// gas legacyOptimized: 113120
|
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
|