Skip to content

Instantly share code, notes, and snippets.

@jleeh
jleeh / itmap.sol
Last active August 21, 2018 17:20 — forked from ethers/itmap.sol
Solidity iterable map (Removes only and last entries)
library itmap {
struct entry {
// Equal to the index of the key of this item in keys, plus 1.
uint keyIndex;
uint value;
}
struct itmap {
mapping(uint => entry) data;
uint[] keys;