Procedurally generate EnumerableSet and EnumerableMap (#3429)
This commit is contained in:
@ -214,7 +214,15 @@ library EnumerableSet {
|
||||
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
|
||||
*/
|
||||
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
|
||||
return _values(set._inner);
|
||||
bytes32[] memory store = _values(set._inner);
|
||||
bytes32[] memory result;
|
||||
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
result := store
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// AddressSet
|
||||
@ -325,7 +333,7 @@ library EnumerableSet {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Returns the number of values on the set. O(1).
|
||||
* @dev Returns the number of values in the set. O(1).
|
||||
*/
|
||||
function length(UintSet storage set) internal view returns (uint256) {
|
||||
return _length(set._inner);
|
||||
|
||||
Reference in New Issue
Block a user