32 should better be replaced by "symbolFactor" (#9203)

Signed-off-by: tanghengjian <1040104807@qq.com>
This commit is contained in:
Jupiter 2021-08-13 19:08:53 +08:00 committed by GitHub
parent 84e786ebc1
commit 84ab705318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1180,7 +1180,7 @@ func newReader(b ByteSlice, c io.Closer) (*Reader, error) {
lastKey = nil lastKey = nil
valueCount = 0 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}) r.postings[key[0]] = append(r.postings[key[0]], postingOffset{value: key[1], off: off})
lastKey = nil lastKey = nil
} else { } else {
@ -1335,7 +1335,7 @@ func (s Symbols) ReverseLookup(sym string) (uint32, error) {
i-- i--
} }
d.Skip(s.offsets[i]) d.Skip(s.offsets[i])
res := i * 32 res := i * symbolFactor
var lastLen int var lastLen int
var lastSymbol string var lastSymbol string
for d.Err() == nil && res <= s.seen { for d.Err() == nil && res <= s.seen {