From 83d60bed89ce831d720b9a28646858372eae7ac4 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Tue, 21 May 2013 23:20:43 +0200 Subject: [PATCH] extractValuesAroundTime() code simplification. --- storage/metric/operation.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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] } } }