From 039c310c557533bab0a97a9865d30f92328ada45 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 13 Nov 2015 23:43:05 +0300 Subject: [PATCH] Replace map { ... }.filterNotNull() with mapNotNull { ... } Original commit: 32151c077e3718851f7a3ca9a55913099d95c2a0 --- .../kotlin/jps/incremental/IncrementalCacheImpl.kt | 2 +- .../org/jetbrains/kotlin/jps/incremental/LookupStorage.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt index 7e33f356920..76166540794 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt @@ -263,7 +263,7 @@ public class IncrementalCacheImpl( val changes = if (IncrementalCompilation.isExperimental()) - dirtyClasses.map { createChangeInfo(it) }.asSequence().filterNotNull() + dirtyClasses.mapNotNull { createChangeInfo(it) }.asSequence() else emptySequence() diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LookupStorage.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LookupStorage.kt index 32903e254f2..0345dbb290c 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LookupStorage.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LookupStorage.kt @@ -59,10 +59,10 @@ class LookupStorage(private val targetDataDir: File) : BasicMapsOwner() { val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope) val fileIds = lookupMap[key] ?: return emptySet() - return fileIds.map { + return fileIds.mapNotNull { // null means it's outdated idToFile[it]?.path - }.filterNotNull() + } } public fun add(lookupSymbol: LookupSymbol, containingPaths: Collection) { @@ -138,7 +138,7 @@ class LookupStorage(private val targetDataDir: File) : BasicMapsOwner() { } for (lookup in lookupMap.keys) { - val fileIds = lookupMap[lookup]!!.map { oldIdToNewId[it] }.filterNotNull().toSet() + val fileIds = lookupMap[lookup]!!.mapNotNull { oldIdToNewId[it] }.toSet() if (fileIds.isEmpty()) { lookupMap.remove(lookup)