using compareTo instead of direct subtraction
This commit is contained in:
parent
a893f5acdb
commit
6c3150edb7
|
@ -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 New Issue