From 355685334781f5338018e916a90fbb9c7303a12a Mon Sep 17 00:00:00 2001 From: "Yaroslav.Chernyshev" Date: Wed, 10 Nov 2021 11:19:40 +0300 Subject: [PATCH] [CHERRY PICKED FROM IJ] [Gradle, Importing] Fix missed optimization GitOrigin-RevId: 4839fb3bd88b135992a4bd1963b566ed77225b28 Original commit: https://github.com/JetBrains/intellij-community/commit/08fe803d3a03a0a89e67a0b24c41d7494b981a5e --- .../kotlin/arguments/CompilerArgumentsContentProspector.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jps/jps-common/src/org/jetbrains/kotlin/arguments/CompilerArgumentsContentProspector.kt b/jps/jps-common/src/org/jetbrains/kotlin/arguments/CompilerArgumentsContentProspector.kt index e67fc4a1b57..92b01d4659c 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/arguments/CompilerArgumentsContentProspector.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/arguments/CompilerArgumentsContentProspector.kt @@ -23,8 +23,9 @@ object CompilerArgumentsContentProspector { private val arrayArgumentPropertiesCache: MutableMap, Collection?>>> = mutableMapOf() - private fun getCompilerArgumentsProperties(kClass: KClass) = + private fun getCompilerArgumentsProperties(kClass: KClass) = argumentPropertiesCache.getOrPut(kClass) { kClass.memberProperties.filter { prop -> prop.annotations.any { it is Argument } } + } private inline fun Collection>.filterByReturnType(predicate: (KType?) -> Boolean) = filter { predicate(it.returnType) }.mapNotNull { it.safeAs>() }