Let's assume we have something like:
contract C {
function externalFunction(uint256[] calldata data) external {
privateFunction(data);
}
function privateFunction(uint256[] memory data) private {
}
}
If I access data
from within externalFuction
it will read it from calldata
, since it is referenced type, thus saving gas. But what will happen when it gets to internalFunction
? Will it create a memory
copy of array or will it read it from the same location since it will JUMP there from externalFunction
?
Referenced documentation would be highly appreciated.