Small improvement for local contact lookup
This commit is contained in:
parent
d366dbf2cc
commit
027cce9756
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue