update Kotlin to 1.4.10 and fix some warnigs (#1963)

This commit is contained in:
Konrad Pozniak 2020-10-25 18:36:00 +01:00 committed by GitHub
commit 6d27d822ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 74 additions and 94 deletions

View file

@ -21,7 +21,6 @@ import com.keylesspalace.tusky.entity.Status
import java.util.*
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.Comparator
/**
* This class caches the account database and handles all account related operations
@ -166,13 +165,13 @@ class AccountManager @Inject constructor(db: AppDatabase) {
*/
fun getAllAccountsOrderedByActive(): List<AccountEntity> {
val accountsCopy = accounts.toMutableList()
accountsCopy.sortWith(Comparator { l, r ->
accountsCopy.sortWith { l, r ->
when {
l.isActive && !r.isActive -> -1
r.isActive && !l.isActive -> 1
else -> 0
}
})
}
return accountsCopy
}