mirror of
https://github.com/jech/galene.git
synced 2024-11-22 00:25:58 +01:00
Use strings.Cut when parsing fmtp.
This commit is contained in:
parent
d2380f25b3
commit
f9ef43248b
1 changed files with 3 additions and 6 deletions
|
@ -181,12 +181,9 @@ func (g *Group) API() (*webrtc.API, error) {
|
|||
func fmtpValue(fmtp, key string) string {
|
||||
fields := strings.Split(fmtp, ";")
|
||||
for _, f := range fields {
|
||||
kv := strings.SplitN(f, "=", 2)
|
||||
if len(kv) != 2 {
|
||||
continue
|
||||
}
|
||||
if kv[0] == key {
|
||||
return kv[1]
|
||||
k, v, found := strings.Cut(f, "=")
|
||||
if found && k == key {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return ""
|
||||
|
|
Loading…
Reference in a new issue