making comparator override non null as kotlin guards against this

This commit is contained in:
Adam Brown 2022-05-17 10:35:14 +01:00
parent 1ec99ee89e
commit 5f2cb671e2
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,8 @@ import org.matrix.android.sdk.api.auth.registration.Stage
class MatrixOrgRegistrationStagesComparator : Comparator<Stage> {
override fun compare(a: Stage?, b: Stage?): Int {
return (a?.toPriority() ?: 0).compareTo(b?.toPriority() ?: 0)
override fun compare(a: Stage, b: Stage): Int {
return a.toPriority().compareTo(b.toPriority())
}
private fun Stage.toPriority() = when (this) {