diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DelegatingDataFlowInfo.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DelegatingDataFlowInfo.kt index 7b2017a3783..dd0360ee674 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DelegatingDataFlowInfo.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DelegatingDataFlowInfo.kt @@ -119,9 +119,7 @@ internal class DelegatingDataFlowInfo private constructor( val enrichedTypes = newLinkedHashSetWithExpectedSize(types.size + 1) val originalType = key.type - for (type in types) { - enrichedTypes.add(type.makeReallyNotNullIfNeeded(languageVersionSettings)) - } + types.mapTo(enrichedTypes) { type -> type.makeReallyNotNullIfNeeded(languageVersionSettings) } if (originalType.canBeDefinitelyNotNullOrNotNull(languageVersionSettings)) { enrichedTypes.add(originalType.makeReallyNotNullIfNeeded(languageVersionSettings)) }