Replace map { ... }.filterNotNull() with mapNotNull { ... }

Original commit: 32151c077e
This commit is contained in:
Ilya Gorbunov
2015-11-13 23:43:05 +03:00
parent cc0adf19a9
commit 039c310c55
2 changed files with 4 additions and 4 deletions
@@ -263,7 +263,7 @@ public class IncrementalCacheImpl(
val changes = val changes =
if (IncrementalCompilation.isExperimental()) if (IncrementalCompilation.isExperimental())
dirtyClasses.map { createChangeInfo(it) }.asSequence().filterNotNull() dirtyClasses.mapNotNull { createChangeInfo(it) }.asSequence()
else else
emptySequence<ChangeInfo>() emptySequence<ChangeInfo>()
@@ -59,10 +59,10 @@ class LookupStorage(private val targetDataDir: File) : BasicMapsOwner() {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope) val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val fileIds = lookupMap[key] ?: return emptySet() val fileIds = lookupMap[key] ?: return emptySet()
return fileIds.map { return fileIds.mapNotNull {
// null means it's outdated // null means it's outdated
idToFile[it]?.path idToFile[it]?.path
}.filterNotNull() }
} }
public fun add(lookupSymbol: LookupSymbol, containingPaths: Collection<String>) { public fun add(lookupSymbol: LookupSymbol, containingPaths: Collection<String>) {
@@ -138,7 +138,7 @@ class LookupStorage(private val targetDataDir: File) : BasicMapsOwner() {
} }
for (lookup in lookupMap.keys) { 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()) { if (fileIds.isEmpty()) {
lookupMap.remove(lookup) lookupMap.remove(lookup)