scorch zap prealloc extra locs for future growth
This commit is contained in:
parent
3f4b161850
commit
fc7584f5a0
|
@ -495,10 +495,10 @@ func (i *PostingsIterator) Next() (segment.Posting, error) {
|
||||||
if cap(i.nextLocs) >= int(rv.freq) {
|
if cap(i.nextLocs) >= int(rv.freq) {
|
||||||
i.nextLocs = i.nextLocs[0:rv.freq]
|
i.nextLocs = i.nextLocs[0:rv.freq]
|
||||||
} else {
|
} else {
|
||||||
i.nextLocs = make([]Location, rv.freq)
|
i.nextLocs = make([]Location, rv.freq, rv.freq * 2)
|
||||||
}
|
}
|
||||||
if cap(i.nextSegmentLocs) < int(rv.freq) {
|
if cap(i.nextSegmentLocs) < int(rv.freq) {
|
||||||
i.nextSegmentLocs = make([]segment.Location, rv.freq)
|
i.nextSegmentLocs = make([]segment.Location, rv.freq, rv.freq * 2)
|
||||||
}
|
}
|
||||||
rv.locs = i.nextSegmentLocs[0:rv.freq]
|
rv.locs = i.nextSegmentLocs[0:rv.freq]
|
||||||
for j := 0; j < int(rv.freq); j++ {
|
for j := 0; j < int(rv.freq); j++ {
|
||||||
|
|
Loading…
Reference in New Issue