Skip to content

Commit 9a67aa5

Browse files
committed
Filter unique integration classes FQNs
1 parent ffc5b03 commit 9a67aa5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

jupyter-lib/api-gradle-plugin/src/main/kotlin/org/jetbrains/kotlinx/jupyter/api/plugin/tasks/JupyterApiResourcesTask.kt

+12-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ open class JupyterApiResourcesTask : DefaultTask() {
6666
)
6767
}
6868

69-
class FQNAware(
69+
data class FQNAware(
7070
val fqn: String
7171
)
7272

@@ -77,8 +77,17 @@ open class JupyterApiResourcesTask : DefaultTask() {
7777

7878
operator fun LibrariesScanResult.plus(other: LibrariesScanResult): LibrariesScanResult {
7979
return LibrariesScanResult(
80-
definitions + other.definitions,
81-
producers + other.producers
80+
union(definitions, other.definitions),
81+
union(producers, other.producers)
8282
)
8383
}
84+
85+
companion object {
86+
private inline fun <reified T> union(a: Array<T>, b: Array<T>): Array<T> {
87+
val result = mutableSetOf<T>()
88+
result.addAll(a)
89+
result.addAll(b)
90+
return result.toTypedArray()
91+
}
92+
}
8493
}

0 commit comments

Comments
 (0)