2020-11-12 14:29:08 +00:00
|
|
|
contract c {
|
|
|
|
uint16[] data;
|
|
|
|
function test() public returns (uint16 x, uint16 y, uint16 z) {
|
|
|
|
for (uint i = 1; i <= 48; i++)
|
|
|
|
data.push(uint16(i));
|
|
|
|
for (uint j = 1; j <= 10; j++)
|
|
|
|
data.pop();
|
|
|
|
x = data[data.length - 1];
|
|
|
|
for (uint k = 1; k <= 10; k++)
|
|
|
|
data.pop();
|
|
|
|
y = data[data.length - 1];
|
|
|
|
for (uint l = 1; l <= 10; l++)
|
|
|
|
data.pop();
|
|
|
|
z = data[data.length - 1];
|
|
|
|
for (uint m = 1; m <= 18; m++)
|
|
|
|
data.pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ----
|
|
|
|
// test() -> 38, 28, 18
|
2022-09-15 10:19:18 +00:00
|
|
|
// gas irOptimized: 185650
|
2022-03-07 18:13:35 +00:00
|
|
|
// gas legacy: 189492
|
2022-06-03 20:04:16 +00:00
|
|
|
// gas legacyOptimized: 178318
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 1
|