0
0
Fork 0

scorch zap postingsIter reuses array positions slice

This commit is contained in:
Steve Yen 2018-03-21 10:19:02 -07:00
parent db792717a6
commit 3f4b161850
1 changed files with 2 additions and 2 deletions

View File

@ -448,10 +448,10 @@ func (i *PostingsIterator) readLocation(l *Location) error {
l.pos = pos
l.start = start
l.end = end
if numArrayPos > 0 {
if cap(l.ap) < int(numArrayPos) {
l.ap = make([]uint64, int(numArrayPos))
} else {
l.ap = l.ap[:0]
l.ap = l.ap[:int(numArrayPos)]
}
}