update Kotlin to 1.4.10 and fix some warnigs (#1963)
This commit is contained in:
parent
e0346a8e88
commit
6d27d822ca
20 changed files with 74 additions and 94 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue