Skip to content

Commit c751556

Browse files
committed
use values() method of EnumerableSet when possible, to make the code simpler
1 parent bf3e362 commit c751556

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/EulerSwapFactory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil, ProtocolFee {
119119

120120
/// @inheritdoc IEulerSwapFactory
121121
function pools() external view returns (address[] memory) {
122-
return _getSlice(allPools, 0, type(uint256).max);
122+
return allPools.values();
123123
}
124124

125125
/// @inheritdoc IEulerSwapFactory
@@ -138,7 +138,7 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil, ProtocolFee {
138138

139139
/// @inheritdoc IEulerSwapFactory
140140
function poolsByPair(address asset0, address asset1) external view returns (address[] memory) {
141-
return _getSlice(poolMap[asset0][asset1], 0, type(uint256).max);
141+
return poolMap[asset0][asset1].values();
142142
}
143143

144144
/// @notice Validates operator authorization for euler account and update the relevant EulerAccountState.

0 commit comments

Comments
 (0)