diff --git a/storage/metric/operation.go b/storage/metric/operation.go index 9c3408c0d7..595cfaf192 100644 --- a/storage/metric/operation.go +++ b/storage/metric/operation.go @@ -111,14 +111,14 @@ func extractValuesAroundTime(t time.Time, in model.Values) (out model.Values) { if in[i].Timestamp.Equal(t) && len(in) > i+1 { // We hit exactly the current sample time. Very unlikely in practice. // Return only the current sample. - out = append(out, in[i]) + out = in[i : i+1] } else { if i == 0 { // We hit before the first sample time. Return only the first sample. - out = append(out, in[0:1]...) + out = in[0:1] } else { // We hit between two samples. Return both surrounding samples. - out = append(out, in[i-1:i+1]...) + out = in[i-1 : i+1] } } }