[Gradle] CInterop commonization: Improve grouping and dependency management
^KT-47775 Verification Pending This implementation will be lenient toward the common *Test.dependsOn(*Main) mistake. ^KT-47053 Verification Pending Support source sets that do not have a dedicated shared native compilation. Also support additional visible source sets coming from associate compilations.
This commit is contained in:
committed by
Space
parent
a7e81d5154
commit
02d4c866ca
@@ -18,7 +18,7 @@ public inline fun <reified T> transitiveClosure(seed: T, edges: T.() -> Iterable
|
||||
val initialEdges = seed.edges()
|
||||
if (initialEdges is Collection && initialEdges.isEmpty()) return emptySet()
|
||||
|
||||
val queue = deque<T>()
|
||||
val queue = deque<T>(initialEdges.count() * 2)
|
||||
val results = mutableSetOf<T>()
|
||||
queue.addAll(initialEdges)
|
||||
while (queue.isNotEmpty()) {
|
||||
@@ -34,7 +34,7 @@ public inline fun <reified T> transitiveClosure(seed: T, edges: T.() -> Iterable
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
@PublishedApi
|
||||
internal inline fun <reified T> deque(): MutableList<T> {
|
||||
return if (KotlinVersion.CURRENT.isAtLeast(1, 4)) ArrayDeque()
|
||||
else mutableListOf()
|
||||
internal inline fun <reified T> deque(initialSize: Int): MutableList<T> {
|
||||
return if (KotlinVersion.CURRENT.isAtLeast(1, 4)) ArrayDeque(initialSize)
|
||||
else ArrayList(initialSize)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user