commonMain.com.strumenta.antlrkotlin.runtime.Collections.kt Maven / Gradle / Ivy
// Copyright 2017-present Strumenta and contributors, licensed under Apache 2.0.
// Copyright 2024-present Strumenta and contributors, licensed under BSD 3-Clause.
package com.strumenta.antlrkotlin.runtime
internal object Collections {
fun > min(collection: Collection): T =
collection.minOrNull() ?: throw NoSuchElementException()
fun > max(collection: Collection): T =
collection.maxOrNull() ?: throw NoSuchElementException()
}