Use sum() instead of reduce operator
This commit is contained in:
parent
bc3fe4e5f6
commit
7d3f6365e2
@ -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…
Reference in New Issue
Block a user