Remove redundant check for null pointer

Pointer is already checked earlier in the function
This commit is contained in:
Artur Shellunts
2023-02-04 09:37:46 +01:00
committed by Steffen Vogel
parent 3ed38e954a
commit c3e0417858
2 changed files with 7 additions and 8 deletions
+1
View File
@@ -8,6 +8,7 @@ Adam Kiss <masterada@gmail.com>
adwpc <adwpc@hotmail.com>
Aleksandr Razumov <ar@gortc.io>
Antoine Baché <antoine@tenten.app>
Artur Shellunts <shellunts.artur@gmail.com>
Assad Obaid <assad@lap5cg901003r.se.axis.com>
Atsushi Watanabe <atsushi.w@ieee.org>
backkem <mail@backkem.me>
+6 -8
View File
@@ -588,14 +588,12 @@ func (a *Agent) setSelectedPair(p *CandidatePair) {
a.updateConnectionState(ConnectionStateConnected)
// Notify when the selected pair changes
if p != nil {
a.afterRun(func(ctx context.Context) {
select {
case a.chanCandidatePair <- p:
case <-ctx.Done():
}
})
}
a.afterRun(func(ctx context.Context) {
select {
case a.chanCandidatePair <- p:
case <-ctx.Done():
}
})
// Signal connected
a.onConnectedOnce.Do(func() { close(a.onConnected) })