From 8eccd1b6e1db39e04747dc7034197e0b2d27c15f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 29 Apr 2024 14:20:46 +0200 Subject: [PATCH] Code optimization. --- .../postprocessor/LastForwardIndicatorsPostProcessor.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt index 8db3952f0d..d717fac00d 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt @@ -65,10 +65,7 @@ private fun createLastForwardIndicator(identifier: String): MatrixTimelineItem { private fun List.latestEventIdentifier(): String { return findLast { - when (it) { - is MatrixTimelineItem.Event -> true - else -> false - } + it is MatrixTimelineItem.Event }?.let { (it as MatrixTimelineItem.Event).uniqueId } ?: "fake_id"