mirror of
https://gitee.com/gitea/gitea
synced 2025-11-16 22:40:26 +08:00
Improve issue search (#2387)
* Improve issue indexer * Fix new issue sqlite bug * Different test indexer paths for each db * Add integration indexer paths to make clean
This commit is contained in:
12
vendor/github.com/blevesearch/bleve/search/pool.go
generated
vendored
12
vendor/github.com/blevesearch/bleve/search/pool.go
generated
vendored
@@ -37,13 +37,17 @@ func defaultDocumentMatchPoolTooSmall(p *DocumentMatchPool) *DocumentMatch {
|
||||
// pre-allocated to accommodate the requested number of DocumentMatch
|
||||
// instances
|
||||
func NewDocumentMatchPool(size, sortsize int) *DocumentMatchPool {
|
||||
avail := make(DocumentMatchCollection, 0, size)
|
||||
avail := make(DocumentMatchCollection, size)
|
||||
// pre-allocate the expected number of instances
|
||||
startBlock := make([]DocumentMatch, size)
|
||||
startSorts := make([]string, size*sortsize)
|
||||
// make these initial instances available
|
||||
for i := range startBlock {
|
||||
startBlock[i].Sort = make([]string, 0, sortsize)
|
||||
avail = append(avail, &startBlock[i])
|
||||
i, j := 0, 0
|
||||
for i < size {
|
||||
avail[i] = &startBlock[i]
|
||||
avail[i].Sort = startSorts[j:j]
|
||||
i += 1
|
||||
j += sortsize
|
||||
}
|
||||
return &DocumentMatchPool{
|
||||
avail: avail,
|
||||
|
||||
Reference in New Issue
Block a user