From 84ab70531845d2c51e9e724ccad4b2c7da45ff49 Mon Sep 17 00:00:00 2001 From: Jupiter <1040104807@qq.com> Date: Fri, 13 Aug 2021 19:08:53 +0800 Subject: [PATCH] 32 should better be replaced by "symbolFactor" (#9203) Signed-off-by: tanghengjian <1040104807@qq.com> --- tsdb/index/index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsdb/index/index.go b/tsdb/index/index.go index 6ddab1e00..d6f5d6b88 100644 --- a/tsdb/index/index.go +++ b/tsdb/index/index.go @@ -1180,7 +1180,7 @@ func newReader(b ByteSlice, c io.Closer) (*Reader, error) { lastKey = nil valueCount = 0 } - if valueCount%32 == 0 { + if valueCount%symbolFactor == 0 { r.postings[key[0]] = append(r.postings[key[0]], postingOffset{value: key[1], off: off}) lastKey = nil } else { @@ -1335,7 +1335,7 @@ func (s Symbols) ReverseLookup(sym string) (uint32, error) { i-- } d.Skip(s.offsets[i]) - res := i * 32 + res := i * symbolFactor var lastLen int var lastSymbol string for d.Err() == nil && res <= s.seen {