diff --git a/src/main/kotlin/io/gitlab/jfronny/sdom/model/SDProblem.kt b/src/main/kotlin/io/gitlab/jfronny/sdom/model/SDProblem.kt index b2d2d69..0c72c7b 100644 --- a/src/main/kotlin/io/gitlab/jfronny/sdom/model/SDProblem.kt +++ b/src/main/kotlin/io/gitlab/jfronny/sdom/model/SDProblem.kt @@ -10,8 +10,6 @@ data class SDProblem(val id: String, val name: String, val rgb: Color, var solve } override fun compareTo(other: SDProblem): Int { - return solved.compareTo(other.solved) - .run { if (this == 0) rgb.rgb.compareTo(other.rgb.rgb) else this } - .run { if (this == 0) name.compareTo(other.name) else this } + return compareValuesBy(this, other, SDProblem::solved, { it.rgb.rgb }, SDProblem::name) } }