0
0
panic in collector_heap
This commit is contained in:
Danny Tylman 2016-09-08 11:40:53 +03:00
parent b961d742c1
commit 6c52907f2b

View File

@ -40,6 +40,9 @@ func (c *collectStoreHeap) RemoveLast() *search.DocumentMatch {
func (c *collectStoreHeap) Final(skip int, fixup collectorFixup) (search.DocumentMatchCollection, error) {
count := c.Len()
size := count - skip
if size <= 0 {
return make(search.DocumentMatchCollection, 0), nil
}
rv := make(search.DocumentMatchCollection, size)
for count > 0 {
count--