Switch to stdlib maps, slices (#4445)

* Switch to stdlib maps, slices

* slices
This commit is contained in:
Raja Subramanian
2026-04-13 00:11:48 +05:30
committed by GitHub
parent ea7b9c6fe1
commit c91e79af35
11 changed files with 33 additions and 30 deletions
+2 -2
View File
@@ -17,6 +17,7 @@ package rtc
import (
"fmt"
"io"
"maps"
"math/rand"
"os"
"slices"
@@ -33,7 +34,6 @@ import (
"github.com/pkg/errors"
"go.uber.org/atomic"
"go.uber.org/zap/zapcore"
"golang.org/x/exp/maps"
"google.golang.org/protobuf/proto"
"github.com/livekit/mediatransportutil/pkg/twcc"
@@ -1443,7 +1443,7 @@ func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseRea
// ensure this is synchronized
p.CloseSignalConnection(types.SignallingCloseReasonParticipantClose)
p.lock.RLock()
onClose := maps.Values(p.onClose)
onClose := slices.Collect(maps.Values(p.onClose))
p.lock.RUnlock()
for _, cb := range onClose {
cb(p)