2020-11-12 14:29:08 +00:00
|
|
|
contract c {
|
|
|
|
struct s { uint[][] d; }
|
|
|
|
s[] data;
|
|
|
|
function fill() public returns (uint) {
|
|
|
|
while (data.length < 3)
|
|
|
|
data.push();
|
|
|
|
while (data[2].d.length < 4)
|
|
|
|
data[2].d.push();
|
|
|
|
while (data[2].d[3].length < 5)
|
|
|
|
data[2].d[3].push();
|
|
|
|
data[2].d[3][4] = 8;
|
|
|
|
return data[2].d[3][4];
|
|
|
|
}
|
|
|
|
function clear() public { delete data; }
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
|
|
|
// ----
|
|
|
|
// storage: empty
|
|
|
|
// fill() -> 8
|
2021-03-11 11:17:50 +00:00
|
|
|
// gas irOptimized: 181160
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 165456
|
|
|
|
// gas legacyOptimized: 164387
|
2020-11-12 14:29:08 +00:00
|
|
|
// storage: nonempty
|
|
|
|
// clear() ->
|
|
|
|
// storage: empty
|