Merge pull request #8961 from lrita/master

remove duplicated code in cacheKeyIterator.encode()
pull/8949/head
Jason Wilder 2017-10-16 10:17:32 -06:00 committed by GitHub
commit e683502dd6
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)