From 89b05b3cb662bfcf6af315a2dba58433ad5789b5 Mon Sep 17 00:00:00 2001 From: saxon Date: Tue, 5 Feb 2019 23:29:07 +1030 Subject: [PATCH] stream/mts/meta/meta.go: using copy instead of append to remove key from order slice in Meta.Delete() --- stream/mts/meta/meta.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream/mts/meta/meta.go b/stream/mts/meta/meta.go index 466cb8e8..bc3a6da6 100644 --- a/stream/mts/meta/meta.go +++ b/stream/mts/meta/meta.go @@ -120,7 +120,8 @@ func (m *Metadata) Delete(key string) error { delete(m.data, key) for i, k := range m.order { 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 } }