- Optimized length load on _addToAddressesProvidersList().

This commit is contained in:
eboado 2020-10-26 11:18:56 +01:00
parent ea66bf3170
commit c14ea749c4

View File

@ -76,7 +76,9 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
* @param provider the pool address to be added
**/
function _addToAddressesProvidersList(address provider) internal {
for (uint256 i = 0; i < _addressesProvidersList.length; i++) {
uint256 providersCount = _addressesProvidersList.length;
for (uint256 i = 0; i < providersCount; i++) {
if (_addressesProvidersList[i] == provider) {
return;
}