From 2f0aa4a420fd68d007affea1f3e31dd9475c79b3 Mon Sep 17 00:00:00 2001 From: lrita Date: Fri, 13 Oct 2017 20:39:15 +0800 Subject: [PATCH] remove duplicated code in cacheKeyIterator.encode() --- tsdb/engine/tsm1/compact.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tsdb/engine/tsm1/compact.go b/tsdb/engine/tsm1/compact.go index f02579d09c..d452db29d9 100644 --- a/tsdb/engine/tsm1/compact.go +++ b/tsdb/engine/tsm1/compact.go @@ -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)