Slice expression simplifications.

This commit is contained in:
Julius Volz 2013-05-07 13:22:29 +02:00
parent 4872ec7577
commit 05afa970d2
2 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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