File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api
src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
package org.jetbrains.kotlinx.dataframe.impl.api
2
2
3
- import com.beust.klaxon.internal.firstNotNullResult
4
3
import org.jetbrains.kotlinx.dataframe.DataColumn
5
4
import org.jetbrains.kotlinx.dataframe.DataFrame
6
5
import org.jetbrains.kotlinx.dataframe.api.asColumnGroup
@@ -89,3 +88,11 @@ internal fun <T> concatImpl(dataFrames: List<DataFrame<T>>): DataFrame<T> {
89
88
dataFrameOf(columns)
90
89
}.cast()
91
90
}
91
+
92
+ private inline fun <T , R : Any > Iterable<T>.firstNotNullResult (transform : (T ) -> R ? ): R ? {
93
+ for (element in this ) {
94
+ val result = transform(element)
95
+ if (result != null ) return result
96
+ }
97
+ return null
98
+ }
Original file line number Diff line number Diff line change 1
1
package org.jetbrains.kotlinx.dataframe.impl.api
2
2
3
- import com.beust.klaxon.internal.firstNotNullResult
4
3
import org.jetbrains.kotlinx.dataframe.DataColumn
5
4
import org.jetbrains.kotlinx.dataframe.DataFrame
6
5
import org.jetbrains.kotlinx.dataframe.api.asColumnGroup
@@ -89,3 +88,11 @@ internal fun <T> concatImpl(dataFrames: List<DataFrame<T>>): DataFrame<T> {
89
88
dataFrameOf(columns)
90
89
}.cast()
91
90
}
91
+
92
+ private inline fun <T , R : Any > Iterable<T>.firstNotNullResult (transform : (T ) -> R ? ): R ? {
93
+ for (element in this ) {
94
+ val result = transform(element)
95
+ if (result != null ) return result
96
+ }
97
+ return null
98
+ }
You can’t perform that action at this time.
0 commit comments