We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be67836 commit b146501Copy full SHA for b146501
vector/src/main/java/im/vector/app/features/notifications/ProcessedEvent.kt
@@ -27,4 +27,6 @@ data class ProcessedEvent<T>(
27
}
28
29
30
-fun <T> List<ProcessedEvent<T>>.onlyKeptEvents() = filter { it.type == ProcessedEvent.Type.KEEP }.map { it.event }
+fun <T> List<ProcessedEvent<T>>.onlyKeptEvents() = mapNotNull { processedEvent ->
31
+ processedEvent.event.takeIf { processedEvent.type == ProcessedEvent.Type.KEEP }
32
+}
0 commit comments