Skip to content

Commit f9ef432

Browse files
committed
Use strings.Cut when parsing fmtp.
1 parent d2380f2 commit f9ef432

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

group/group.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,9 @@ func (g *Group) API() (*webrtc.API, error) {
181181
func fmtpValue(fmtp, key string) string {
182182
fields := strings.Split(fmtp, ";")
183183
for _, f := range fields {
184-
kv := strings.SplitN(f, "=", 2)
185-
if len(kv) != 2 {
186-
continue
187-
}
188-
if kv[0] == key {
189-
return kv[1]
184+
k, v, found := strings.Cut(f, "=")
185+
if found && k == key {
186+
return v
190187
}
191188
}
192189
return ""

0 commit comments

Comments
 (0)