mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
do not filter duplicates prematurely
This commit is contained in:
@ -53,7 +53,7 @@ class ContactsHelper(val context: Context) {
|
|||||||
|
|
||||||
val contactsSize = contacts.size()
|
val contactsSize = contacts.size()
|
||||||
val showOnlyContactsWithNumbers = context.config.showOnlyContactsWithNumbers
|
val showOnlyContactsWithNumbers = context.config.showOnlyContactsWithNumbers
|
||||||
var tempContacts = ArrayList<Contact>(contactsSize)
|
val tempContacts = ArrayList<Contact>(contactsSize)
|
||||||
val resultContacts = ArrayList<Contact>(contactsSize)
|
val resultContacts = ArrayList<Contact>(contactsSize)
|
||||||
|
|
||||||
(0 until contactsSize).filter {
|
(0 until contactsSize).filter {
|
||||||
@ -67,10 +67,6 @@ class ContactsHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ignoredContactSources.isEmpty() && !getAll) {
|
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 ->
|
tempContacts.filter { displayContactSources.contains(it.source) }.groupBy { "${it.getNameToDisplay().toLowerCase()}${it.emails}" }.values.forEach { it ->
|
||||||
if (it.size == 1) {
|
if (it.size == 1) {
|
||||||
resultContacts.add(it.first())
|
resultContacts.add(it.first())
|
||||||
|
Reference in New Issue
Block a user