override fun compareTo()

in hot-reload-core/src/main/kotlin/org/jetbrains/compose/reload/core/Version.kt [50:64]


    override fun compareTo(other: Qualifier): Int {
        splits.withIndex().forEach { (index, thisSplit) ->
            val otherSplit = other.splits.getOrNull(index) ?: return -1
            val thisSplitNumber = thisSplit.toIntOrNull()
            val otherSplitNumber = otherSplit.toIntOrNull()

            if (thisSplitNumber != null && otherSplitNumber != null) {
                if (thisSplitNumber != otherSplitNumber) return thisSplitNumber.compareTo(otherSplitNumber)
            } else if (thisSplit != otherSplit) {
                return thisSplit.compareTo(otherSplit)
            }
        }

        return 0
    }