Update SimpleContact.kt

This commit is contained in:
Tibor Kaputa 2022-02-11 20:35:17 +01:00 committed by GitHub
parent cde3a3a4fb
commit 4b7bd893ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,11 +31,11 @@ data class SimpleContact(
return if (text.isNotEmpty()) {
val normalizedText = text.normalizePhoneNumber()
if (normalizedText.isEmpty()) {
phoneNumbers.mapNotNull { it.normalizedNumber }.any { phoneNumber ->
phoneNumbers.map { it.normalizedNumber }.any { phoneNumber ->
phoneNumber.contains(text)
}
} else {
phoneNumbers.mapNotNull { it.normalizedNumber }.any { phoneNumber ->
phoneNumbers.map { it.normalizedNumber }.any { phoneNumber ->
PhoneNumberUtils.compare(phoneNumber.normalizePhoneNumber(), normalizedText) ||
phoneNumber.contains(text) ||
phoneNumber.normalizePhoneNumber().contains(normalizedText) ||
@ -51,11 +51,11 @@ data class SimpleContact(
return if (text.isNotEmpty()) {
val normalizedText = text.normalizePhoneNumber()
if (normalizedText.isEmpty()) {
phoneNumbers.mapNotNull { it.normalizedNumber }.any { phoneNumber ->
phoneNumbers.map { it.normalizedNumber }.any { phoneNumber ->
phoneNumber == text
}
} else {
phoneNumbers.mapNotNull { it.normalizedNumber }.any { phoneNumber ->
phoneNumbers.map { it.normalizedNumber }.any { phoneNumber ->
PhoneNumberUtils.compare(phoneNumber.normalizePhoneNumber(), normalizedText) ||
phoneNumber == text ||
phoneNumber.normalizePhoneNumber() == normalizedText ||