Is it possible to just "extend" an array length directly in Assembly?
Ideally that would fill the new values with equivalent "0
" values.
Example:
address[] internal owners;
function mint(to, amount) {
owners.push(to);
assembly {
// owners.length += amount - 1... :-S
}
}
I am trying to avoid/optimize this:
function mint(to, amount) {
owners.push(to);
for (uint256 i; i < amount - 1; i++) {
owners.push(address(0));
}
}