do not filter duplicates prematurely

This commit is contained in:
tibbi 2019-09-16 19:14:47 +02:00
parent f6c4e17bb8
commit d167e15681

View file

@ -53,7 +53,7 @@ class ContactsHelper(val context: Context) {
val contactsSize = contacts.size()
val showOnlyContactsWithNumbers = context.config.showOnlyContactsWithNumbers
var tempContacts = ArrayList<Contact>(contactsSize)
val tempContacts = ArrayList<Contact>(contactsSize)
val resultContacts = ArrayList<Contact>(contactsSize)
(0 until contactsSize).filter {
@ -67,10 +67,6 @@ class ContactsHelper(val context: Context) {
}
if (ignoredContactSources.isEmpty() && !getAll) {
tempContacts = tempContacts.distinctBy {
it.getHashToCompare()
} as ArrayList<Contact>
tempContacts.filter { displayContactSources.contains(it.source) }.groupBy { "${it.getNameToDisplay().toLowerCase()}${it.emails}" }.values.forEach { it ->
if (it.size == 1) {
resultContacts.add(it.first())