Small improvement for local contact lookup

This commit is contained in:
Sylvain Berfini 2022-04-06 19:57:17 +02:00
parent d366dbf2cc
commit 027cce9756

View file

@ -155,10 +155,7 @@ class ContactsManager(private val context: Context) {
@Synchronized @Synchronized
fun findContactByAddress(address: Address): Friend? { fun findContactByAddress(address: Address): Friend? {
for (friend in localFriends) { for (friend in localFriends) {
val found = friend.addresses.find { if (friend.address?.weakEqual(address) == true) {
it.weakEqual(address)
}
if (found != null) {
return friend return friend
} }
} }