[CHERRY PICKED FROM IJ] [Gradle, Importing] Fix missed optimization
GitOrigin-RevId: 4839fb3bd88b135992a4bd1963b566ed77225b28 Original commit: https://github.com/JetBrains/intellij-community/commit/08fe803d3a03a0a89e67a0b24c41d7494b981a5e
This commit is contained in:
committed by
Nikita Bobko
parent
6cc7566b2e
commit
3556853347
+2
-1
@@ -23,8 +23,9 @@ object CompilerArgumentsContentProspector {
|
||||
private val arrayArgumentPropertiesCache: MutableMap<KClass<out CommonToolArguments>, Collection<KProperty1<out CommonToolArguments, Array<String>?>>> =
|
||||
mutableMapOf()
|
||||
|
||||
private fun getCompilerArgumentsProperties(kClass: KClass<out CommonToolArguments>) =
|
||||
private fun getCompilerArgumentsProperties(kClass: KClass<out CommonToolArguments>) = argumentPropertiesCache.getOrPut(kClass) {
|
||||
kClass.memberProperties.filter { prop -> prop.annotations.any { it is Argument } }
|
||||
}
|
||||
|
||||
private inline fun <reified R : Any?> Collection<KProperty1<out CommonToolArguments, *>>.filterByReturnType(predicate: (KType?) -> Boolean) =
|
||||
filter { predicate(it.returnType) }.mapNotNull { it.safeAs<KProperty1<CommonToolArguments, R>>() }
|
||||
|
||||
Reference in New Issue
Block a user