[DOCS] Use calldata whenever that is sufficient in solidity-by-example section #11767
Comments
Hi @hrkrshnn could you link me to the location of the file i would like to help with this issue |
Hi @hrkrshnn i have made the changes could you review and let me know thanks |
Other examples
Functions in |
Can I refer some resources online for further understanding to fix this issue |
@v-sreekesh Maybe https://docs.soliditylang.org/en/v0.8.7/types.html?highlight=calldata#data-location? I would recommend running the example in remix, and seeing how the gas changes when |
Will check and compare the difference in remix for gas consumption |
Changing
memory
tocalldata
for this example is better.Unless the code explicitly requires the argument to be in memory, and doesn't modify the argument, keeping it in calldata is more efficient gas wise.
There are a couple of other places in the documentation that could use this change.
The text was updated successfully, but these errors were encountered: