Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adds getter.
  • Loading branch information
Micah Zoltu authored Jan 30, 2020
commit 3752ee6d92e6063a887a817f6f4cd376f3401032
4 changes: 4 additions & 0 deletions contracts/utils/EnumerableMap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ library EnumerableMap {
require(map.entries[index].key != key, "Removed key still exists in the array at original index.");
}

function get(Map storage map, address key) internal view returns (uint8) {
return map.entries[map.index[key]].value;
}

function enumerate(Map storage map) internal view returns (Entry[] memory) {
Entry[] memory output = new Entry[](map.entries.length - 1);

Expand Down