From 05afa970d21240f56807e975184b90d1d4f1e2e8 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Tue, 7 May 2013 13:22:29 +0200 Subject: [PATCH] Slice expression simplifications. --- storage/metric/operation.go | 12 ++++++------ storage/metric/tiered.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/storage/metric/operation.go b/storage/metric/operation.go index c3a5a5970..8566f59e3 100644 --- a/storage/metric/operation.go +++ b/storage/metric/operation.go @@ -381,7 +381,7 @@ func optimizeForward(pending ops) (out ops) { tail ops ) - pending = pending[1:len(pending)] + pending = pending[1:] switch t := head.(type) { case *getValuesAtTimeOp: @@ -434,7 +434,7 @@ func optimizeForward(pending ops) (out ops) { switch next := peekOperation.(type) { // All values at a specific time may be elided into the range query. case *getValuesAtTimeOp: - pending = pending[1:len(pending)] + pending = pending[1:] continue case *getValuesAlongRangeOp: // Range queries should be concatenated if they overlap. @@ -443,10 +443,10 @@ func optimizeForward(pending ops) (out ops) { return optimizeForward(pending) } else { - pending = pending[1:len(pending)] + pending = pending[1:] } case *getValuesAtIntervalOp: - pending = pending[1:len(pending)] + pending = pending[1:] if next.GreedierThan(t) { var ( @@ -488,7 +488,7 @@ func selectQueriesForTime(time time.Time, queries ops) (out ops) { } out = append(out, queries[0]) - tail := selectQueriesForTime(time, queries[1:len(queries)]) + tail := selectQueriesForTime(time, queries[1:]) return append(out, tail...) } @@ -682,7 +682,7 @@ func optimizeTimeGroups(pending ops) (out ops) { ) out = optimizeTimeGroup(groupedQueries) - pending = pending[len(groupedQueries):len(pending)] + pending = pending[len(groupedQueries):] tail := optimizeTimeGroups(pending) diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index 9994260c8..c3b336ecf 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -394,7 +394,7 @@ func (t TieredStorage) renderView(viewJob viewJob) { // If we aimed past the newest value on disk, combine it with the next value from memory. if len(memValues) > 0 && diskValues.LastTimeBefore(targetTime) { - latestDiskValue := diskValues[len(diskValues)-1 : len(diskValues)] + latestDiskValue := diskValues[len(diskValues)-1:] chunk = append(latestDiskValue, memValues...) } else { chunk = diskValues