From 33e7a232085fe030e01f5da12bcdee658132b4a9 Mon Sep 17 00:00:00 2001 From: Ivan Gavrilovic Date: Thu, 11 Apr 2019 13:40:41 -0700 Subject: [PATCH] Fix style in classpath snapshot class Use filterTo instead of filter followed by forEach. --- .../gradle/internal/kapt/incremental/ClasspathSnapshot.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/incremental/ClasspathSnapshot.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/incremental/ClasspathSnapshot.kt index 4926ba98c77..5c7d77f3f29 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/incremental/ClasspathSnapshot.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/incremental/ClasspathSnapshot.kt @@ -97,9 +97,7 @@ open class ClasspathSnapshot protected constructor( // We do not compute structural data for unchanged files of the current snapshot for performance reasons. // That is why we reuse the previous snapshot as that one contains all unchanged entries. - previousData.filter { !computedClasspathData.containsKey(it.key) }.forEach { - computedClasspathData[it.key] = it.value - } + previousData.filterTo(computedClasspathData) { (key, _) -> key !in computedClasspathData } val allImpactedClasses = findAllImpacted(changedClasses)