EnumerableSet improvements (#2077)
* Remove newAddressSet
* Add count and get functions.
* Fix lint
(cherry picked from commit 7988c044e0)
This commit is contained in:
@ -9,10 +9,6 @@ contract EnumerableSetMock{
|
||||
|
||||
EnumerableSet.AddressSet private set;
|
||||
|
||||
constructor() public {
|
||||
set = EnumerableSet.newAddressSet();
|
||||
}
|
||||
|
||||
function contains(address value) public view returns (bool) {
|
||||
return set.contains(value);
|
||||
}
|
||||
@ -30,4 +26,12 @@ contract EnumerableSetMock{
|
||||
function enumerate() public view returns (address[] memory) {
|
||||
return set.enumerate();
|
||||
}
|
||||
|
||||
function length() public view returns (uint256) {
|
||||
return set.length();
|
||||
}
|
||||
|
||||
function get(uint256 index) public view returns (address) {
|
||||
return set.get(index);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user