All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.Preconditions.kt Maven / Gradle / Ivy

There is a newer version: 0.11.4
Show newest version
package com.juul.krayon.chart

internal fun checkRectangular(listOfLists: List>) {
    if (listOfLists.isEmpty()) return

    val expectedLength = listOfLists.first().size
    for (index in 1 until listOfLists.size) {
        val innerListLength = listOfLists[index].size
        check(innerListLength == expectedLength) {
            "List is not rectangular. Found inner list at index $index with length $innerListLength, but previous lists had length $expectedLength."
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy