Skip to content

Commit ad606ca

Browse files
Convert some more uses of the Java stream API to native Kotlin idioms. (#1982)
1 parent f21bd3c commit ad606ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jvb/src/main/kotlin/org/jitsi/videobridge/cc/allocation/AllocationSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ internal class AllocationSettingsWrapper(private val useSourceNames: Boolean) {
137137
// Convert endpoint IDs to source names
138138
if (!useSourceNames) {
139139
newConstraints = HashMap(it.size)
140-
it.entries.stream().forEach {
140+
it.entries.forEach {
141141
entry ->
142142
newConstraints[endpointIdToSourceName(entry.key)] = entry.value
143143
}

jvb/src/main/kotlin/org/jitsi/videobridge/xmpp/config/XmppClientConnectionConfig.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class XmppClientConnectionConfig private constructor() {
5252
* The interval at which presence updates (with updates stats/status) are published. Allow to be overridden by
5353
* legacy-style "stats-transports" config.
5454
*/
55-
val presenceInterval: Duration = StatsManagerConfig.config.transportConfigs.stream()
56-
.filter { tc -> tc is StatsTransportConfig.MucStatsTransportConfig }
55+
val presenceInterval: Duration = StatsManagerConfig.config.transportConfigs
56+
.filterIsInstance<StatsTransportConfig.MucStatsTransportConfig>()
5757
.map(StatsTransportConfig::interval)
58-
.findFirst()
59-
.orElse(presenceIntervalProperty)
58+
.firstOrNull()
59+
?: presenceIntervalProperty
6060

6161
/**
6262
* Whether to filter the statistics.

0 commit comments

Comments
 (0)