mirror of https://bitbucket.org/ausocean/av.git
stream/mts/meta/meta.go: using copy instead of append to remove key from order slice in Meta.Delete()
This commit is contained in:
parent
cf73c853b0
commit
89b05b3cb6
|
@ -120,7 +120,8 @@ func (m *Metadata) Delete(key string) error {
|
||||||
delete(m.data, key)
|
delete(m.data, key)
|
||||||
for i, k := range m.order {
|
for i, k := range m.order {
|
||||||
if k == key {
|
if k == key {
|
||||||
m.order = append(m.order[:i], m.order[i+1:]...)
|
copy(m.order[:i], m.order[i+1:])
|
||||||
|
m.order = m.order[:len(m.order)-1]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue