remove duplicated code in cacheKeyIterator.encode()

pull/8961/head
lrita 2017-10-13 20:39:15 +08:00
parent 84583edf97
commit 2f0aa4a420
1 changed files with 0 additions and 8 deletions

View File

@ -1488,25 +1488,17 @@ func (c *cacheKeyIterator) encode() {
minTime, maxTime := values[0].UnixNano(), values[end-1].UnixNano() minTime, maxTime := values[0].UnixNano(), values[end-1].UnixNano()
var b []byte var b []byte
var err error var err error
tenc.Reset()
maxTime = values[end-1].UnixNano()
switch values[0].(type) { switch values[0].(type) {
case FloatValue: case FloatValue:
fenc.Reset()
b, err = encodeFloatBlockUsing(nil, values[:end], tenc, fenc) b, err = encodeFloatBlockUsing(nil, values[:end], tenc, fenc)
case IntegerValue: case IntegerValue:
ienc.Reset()
b, err = encodeIntegerBlockUsing(nil, values[:end], tenc, ienc) b, err = encodeIntegerBlockUsing(nil, values[:end], tenc, ienc)
case UnsignedValue: case UnsignedValue:
uenc.Reset()
b, err = encodeUnsignedBlockUsing(nil, values[:end], tenc, uenc) b, err = encodeUnsignedBlockUsing(nil, values[:end], tenc, uenc)
case BooleanValue: case BooleanValue:
benc.Reset()
b, err = encodeBooleanBlockUsing(nil, values[:end], tenc, benc) b, err = encodeBooleanBlockUsing(nil, values[:end], tenc, benc)
case StringValue: case StringValue:
senc.Reset()
b, err = encodeStringBlockUsing(nil, values[:end], tenc, senc) b, err = encodeStringBlockUsing(nil, values[:end], tenc, senc)
default: default:
b, err = Values(values[:end]).Encode(nil) b, err = Values(values[:end]).Encode(nil)