.dokka.kotlin-as-java-plugin.1.9.10.source-code.CollectionExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-as-java-plugin Show documentation
Show all versions of kotlin-as-java-plugin Show documentation
Dokka is an API documentation engine for Kotlin
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package org.jetbrains.dokka.kotlinAsJava
// TODO [beresnev] remove this copy-paste and use the same method from stdlib instead after updating to 1.5
internal inline fun Iterable.firstNotNullOfOrNull(transform: (T) -> R?): R? {
for (element in this) {
val result = transform(element)
if (result != null) {
return result
}
}
return null
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy