Skip to content

Commit 23d9294

Browse files
committed
Use switch statement
Signed-off-by: Šimon Brandner <[email protected]>
1 parent 7be5186 commit 23d9294

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/conference/data_channel_message_processor.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ func (c *Conference) processTrackSubscriptionDCMessage(
5151
func (c *Conference) processNegotiateDCMessage(participant *Participant, msg event.FocusCallNegotiateEventContent) {
5252
participant.streamMetadata = msg.SDPStreamMetadata
5353

54-
if msg.Description.Type == event.CallDataTypeOffer {
54+
switch msg.Description.Type {
55+
case event.CallDataTypeOffer:
5556
participant.logger.WithField("SDP", msg.Description.SDP).Trace("Received SDP offer over DC")
5657

5758
answer, err := participant.peer.ProcessSDPOffer(msg.Description.SDP)
@@ -72,14 +73,14 @@ func (c *Conference) processNegotiateDCMessage(participant *Participant, msg eve
7273
},
7374
},
7475
})
75-
} else if msg.Description.Type == event.CallDataTypeAnswer {
76+
case event.CallDataTypeAnswer:
7677
participant.logger.WithField("SDP", msg.Description.SDP).Trace("Received SDP answer over DC")
7778

7879
if err := participant.peer.ProcessSDPAnswer(msg.Description.SDP); err != nil {
7980
participant.logger.Errorf("Failed to set SDP answer: %v", err)
8081
return
8182
}
82-
} else {
83+
default:
8384
participant.logger.Errorf("Unknown SDP description type")
8485
}
8586
}

0 commit comments

Comments
 (0)