From d4efc8d81d5b4be36a48d6cc781af6caaccec99f Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Sun, 28 Aug 2022 16:37:51 -0700 Subject: [PATCH] SLC: use partition to distinguish ctor properties from regular members --- .../light/classes/symbol/classes/symbolLightClassUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/classes/symbolLightClassUtils.kt b/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/classes/symbolLightClassUtils.kt index 92088c88dcf..07768df47c5 100644 --- a/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/classes/symbolLightClassUtils.kt +++ b/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/classes/symbolLightClassUtils.kt @@ -176,7 +176,7 @@ internal fun SymbolLightClassBase.createMethods( isTopLevel: Boolean = false, suppressStatic: Boolean = false ) { - val declarationGroups = declarations.groupBy { it is KtPropertySymbol && it.isFromPrimaryConstructor } + val (ctorProperties, regularMembers) = declarations.partition { it is KtPropertySymbol && it.isFromPrimaryConstructor } fun handleDeclaration(declaration: KtCallableSymbol) { when (declaration) { @@ -229,11 +229,11 @@ internal fun SymbolLightClassBase.createMethods( } // Regular members - declarationGroups[false]?.forEach { + regularMembers.forEach { handleDeclaration(it) } // Then, properties from the primary constructor parameters - declarationGroups[true]?.forEach { + ctorProperties.forEach { handleDeclaration(it) } }