# UNDF: UNDF-2026-000000925 --- a/lib/exchange/utils/currency_pairs_utils.dart +++ b/lib/exchange/utils/currency_pairs_utils.dart @@ -1,12 +1,13 @@ import 'package:cake_wallet/exchange/exchange_pair.dart'; import 'package:cw_core/crypto_currency.dart'; List supportedPairs(List notSupported) { + final notSupportedSet = notSupported.toSet(); final supportedCurrencies = - CryptoCurrency.all.where((element) => !notSupported.contains(element)).toList(); + CryptoCurrency.all.where((element) => !notSupportedSet.contains(element)).toList(); return supportedCurrencies .map((i) => supportedCurrencies.map((k) => ExchangePair(from: i, to: k, reverse: true))) .expand((i) => i) .toList(); } --- a/lib/buy/pairs_utils.dart +++ b/lib/buy/pairs_utils.dart @@ -11,8 +11,10 @@ List> supportedCryptoToFiatPairs({ required List notSupportedCrypto, required List notSupportedFiat, }) { + final notSupportedCryptoSet = notSupportedCrypto.toSet(); + final notSupportedFiatSet = notSupportedFiat.toSet(); final supportedCrypto = - CryptoCurrency.all.where((crypto) => !notSupportedCrypto.contains(crypto)).toList(); - final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiat.contains(fiat)).toList(); + CryptoCurrency.all.where((crypto) => !notSupportedCryptoSet.contains(crypto)).toList(); + final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiatSet.contains(fiat)).toList(); return supportedCrypto .expand((crypto) => supportedFiat @@ -25,8 +27,10 @@ List> supportedFiatToCryptoPairs({ required List notSupportedFiat, required List notSupportedCrypto, }) { - final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiat.contains(fiat)).toList(); + final notSupportedFiatSet = notSupportedFiat.toSet(); + final notSupportedCryptoSet = notSupportedCrypto.toSet(); + final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiatSet.contains(fiat)).toList(); final supportedCrypto = - CryptoCurrency.all.where((crypto) => !notSupportedCrypto.contains(crypto)).toList(); + CryptoCurrency.all.where((crypto) => !notSupportedCryptoSet.contains(crypto)).toList(); return supportedFiat