From f61686fcbf65e1419ad11a20e65e545b07f36fcd Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Fri, 20 Oct 2017 13:26:35 +0300 Subject: [PATCH] Minor. Convert loop to 'mapTo' call --- .../kotlin/resolve/calls/smartcasts/DelegatingDataFlowInfo.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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)) }