mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
using compareTo instead of direct subtraction
This commit is contained in:
parent
a893f5acdb
commit
6c3150edb7
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ import org.matrix.android.sdk.api.auth.registration.Stage
|
||||||
class FtueMissingRegistrationStagesComparator : Comparator<Stage> {
|
class FtueMissingRegistrationStagesComparator : Comparator<Stage> {
|
||||||
|
|
||||||
override fun compare(a: Stage?, b: Stage?): Int {
|
override fun compare(a: Stage?, b: Stage?): Int {
|
||||||
return (a?.toPriority() ?: 0) - (b?.toPriority() ?: 0)
|
return (a?.toPriority() ?: 0).compareTo(b?.toPriority() ?: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Stage.toPriority() = when (this) {
|
private fun Stage.toPriority() = when (this) {
|
||||||
|
|
Loading…
Reference in a new issue