Skip to content

Commit a0d4b1c

Browse files
committed
Format
1 parent 06e81e0 commit a0d4b1c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/LiveKit/Agent/Room+Agent.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ public extension Room {
2222
/// All agent participants in the Room
2323
var agentParticipants: [Participant.Identity: RemoteParticipant] {
2424
// Filter out agents that are replaced by another agent e.g. avatar worker
25-
let onBehalf = Set(remoteParticipants.map(\.value.attributes[publishOnBehalfAttributeKey]).compactMap { $0 })
26-
return remoteParticipants.filter { $0.value.isAgent && !onBehalf.contains($0.key.stringValue) }
25+
let onBehalfIdentities = Set(remoteParticipants.compactMap {
26+
$0.value.attributes[publishOnBehalfAttributeKey]
27+
})
28+
return remoteParticipants.filter {
29+
$0.value.isAgent && !onBehalfIdentities.contains($0.key.stringValue)
30+
}
2731
}
2832

2933
/// The first agent participant in the Room

0 commit comments

Comments
 (0)