From 7d3f6365e28c77de9115b1b2777e149c53a2380f Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Mon, 31 Oct 2022 17:08:56 +0100 Subject: [PATCH] Use sum() instead of reduce operator --- .../home/room/detail/timeline/helper/TimelineEventsGroups.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineEventsGroups.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineEventsGroups.kt index 7738b6b680..a4bfa9e155 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineEventsGroups.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineEventsGroups.kt @@ -151,6 +151,6 @@ class VoiceBroadcastEventsGroup(private val group: TimelineEventsGroup) { } fun getDuration(): Int { - return group.events.mapNotNull { it.root.asMessageAudioEvent()?.duration }.reduceOrNull { acc, duration -> acc + duration } ?: 0 + return group.events.mapNotNull { it.root.asMessageAudioEvent()?.duration }.sum() } }