everx-labs / TVM-Solidity-Compiler

Solidity compiler for TVM
GNU General Public License v3.0
125 stars 72 forks source link

Proposal: Add method for mapping #143

Closed pyAndr3w closed 1 year ago

pyAndr3w commented 1 year ago

At the moment, to remove an element from mapping, we can only use

delete mapping[key]

However, in TVM there is an opcode for simultaneous deletion and retrieval of an element - DICTDELGET.

It would be very convenient to use this method to save on gas.


expected syntax:

<map>.getDel(KeyType key) returns (optional(ValueType));
cryshado commented 1 year ago

@pyAndr3w Hi, thank you for the issue! We plan to implement this in the next version

cryshado commented 1 year ago

Implemented in 0.71.0 (2023-07-20) #141