From d0262448719b3b04b8ac324e6f86e62cefe0764f Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 22 Apr 2020 13:09:50 +0200 Subject: [PATCH] Moved check for null or empty to findBankByNameBankCodeOrCity() --- .../java/net/dankito/banking/ui/presenter/BankingPresenter.kt | 4 ---- .../src/main/kotlin/net/dankito/fints/banks/BankFinder.kt | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt index 44de1399..2390a0d1 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -273,10 +273,6 @@ open class BankingPresenter( } open fun searchBanksByNameBankCodeOrCity(query: String?): List { - if (query == null || query.isEmpty()) { - return bankFinder.getBankList() - } - return bankFinder.findBankByNameBankCodeOrCity(query) } diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/banks/BankFinder.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/banks/BankFinder.kt index 38397a59..d26af433 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/banks/BankFinder.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/banks/BankFinder.kt @@ -23,8 +23,8 @@ open class BankFinder { return getBankList().filter { it.bankCode.startsWith(query) } } - open fun findBankByNameBankCodeOrCity(query: String): List { - if (query.isEmpty()) { + open fun findBankByNameBankCodeOrCity(query: String?): List { + if (query.isNullOrEmpty()) { return getBankList() }