Skip to content

Commit

Permalink
Filter unique integration classes FQNs
Browse files Browse the repository at this point in the history
  • Loading branch information
ileasile committed Feb 16, 2021
1 parent ffc5b03 commit 9a67aa5
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ open class JupyterApiResourcesTask : DefaultTask() {
)
}

class FQNAware(
data class FQNAware(
val fqn: String
)

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

operator fun LibrariesScanResult.plus(other: LibrariesScanResult): LibrariesScanResult {
return LibrariesScanResult(
definitions + other.definitions,
producers + other.producers
union(definitions, other.definitions),
union(producers, other.producers)
)
}

companion object {
private inline fun <reified T> union(a: Array<T>, b: Array<T>): Array<T> {
val result = mutableSetOf<T>()
result.addAll(a)
result.addAll(b)
return result.toTypedArray()
}
}
}

0 comments on commit 9a67aa5

Please sign in to comment.