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()
var b []byte
var err error
tenc.Reset()
maxTime = values[end-1].UnixNano()
switch values[0].(type) {
case FloatValue:
fenc.Reset()
b, err = encodeFloatBlockUsing(nil, values[:end], tenc, fenc)
case IntegerValue:
ienc.Reset()
b, err = encodeIntegerBlockUsing(nil, values[:end], tenc, ienc)
case UnsignedValue:
uenc.Reset()
b, err = encodeUnsignedBlockUsing(nil, values[:end], tenc, uenc)
case BooleanValue:
benc.Reset()
b, err = encodeBooleanBlockUsing(nil, values[:end], tenc, benc)
case StringValue:
senc.Reset()
b, err = encodeStringBlockUsing(nil, values[:end], tenc, senc)
default:
b, err = Values(values[:end]).Encode(nil)