Skip to content

[DOCS] Use calldata whenever that is sufficient in solidity-by-example section #11767

@hrkrshnn

Description

@hrkrshnn
    /// Reveal your blinded bids. You will get a refund for all
    /// correctly blinded invalid bids and for all bids except for
    /// the totally highest.
    function reveal(
        uint[] memory _values,
        bool[] memory _fake,
        bytes32[] memory _secret
    )

Changing memory to calldata 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions