mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 04:08:44 +03:00
Use sum() instead of reduce operator
This commit is contained in:
parent
bc3fe4e5f6
commit
7d3f6365e2
1 changed files with 1 additions and 1 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue