Minor performance improvements in tryToCompleteWithBuilderInference
This commit is contained in:
committed by
teamcity
parent
98cdc95cd0
commit
756ff6cf43
+3
-2
@@ -188,14 +188,15 @@ class ConstraintSystemCompleter(components: BodyResolveComponents, private val c
|
||||
|
||||
// We assume useBuilderInferenceWithoutAnnotation = true for FIR
|
||||
|
||||
val builder = getBuilder()
|
||||
for (argument in lambdaArguments) {
|
||||
val notFixedInputTypeVariables = argument.inputTypes
|
||||
.map { it.extractTypeVariables() }.flatten().filter { it !in fixedTypeVariables }
|
||||
.flatMap { it.extractTypeVariables() }.filter { it !in fixedTypeVariables }
|
||||
|
||||
if (notFixedInputTypeVariables.isEmpty()) continue
|
||||
|
||||
for (variable in notFixedInputTypeVariables) {
|
||||
getBuilder().markPostponedVariable(notFixedTypeVariables.getValue(variable).typeVariable)
|
||||
builder.markPostponedVariable(notFixedTypeVariables.getValue(variable).typeVariable)
|
||||
}
|
||||
|
||||
analyze(argument)
|
||||
|
||||
+3
-2
@@ -216,17 +216,18 @@ class KotlinConstraintSystemCompleter(
|
||||
val useBuilderInferenceWithoutAnnotation =
|
||||
languageVersionSettings.supportsFeature(LanguageFeature.UseBuilderInferenceWithoutAnnotation)
|
||||
|
||||
val builder = getBuilder()
|
||||
for (argument in lambdaArguments) {
|
||||
if (!argument.atom.hasBuilderInferenceAnnotation && !useBuilderInferenceWithoutAnnotation)
|
||||
continue
|
||||
|
||||
val notFixedInputTypeVariables = argument.inputTypes
|
||||
.map { it.extractTypeVariables() }.flatten().filter { it !in fixedTypeVariables }
|
||||
.flatMap { it.extractTypeVariables() }.filter { it !in fixedTypeVariables }
|
||||
|
||||
if (notFixedInputTypeVariables.isEmpty()) continue
|
||||
|
||||
for (variable in notFixedInputTypeVariables) {
|
||||
getBuilder().markPostponedVariable(notFixedTypeVariables.getValue(variable).typeVariable)
|
||||
builder.markPostponedVariable(notFixedTypeVariables.getValue(variable).typeVariable)
|
||||
}
|
||||
|
||||
analyze(argument)
|
||||
|
||||
Reference in New Issue
Block a user