optimize disjunction scorer to avoid locations alloc if unneeded
This commit is contained in:
parent
988dfb02e9
commit
647a039a6f
|
@ -32,7 +32,7 @@ func (s *DisjunctionQueryScorer) Score(ctx *search.SearchContext, constituents [
|
|||
childrenExplanations = make([]*search.Explanation, len(constituents))
|
||||
}
|
||||
|
||||
locations := []search.FieldTermLocationMap{}
|
||||
var locations []search.FieldTermLocationMap
|
||||
for i, docMatch := range constituents {
|
||||
sum += docMatch.Score
|
||||
if s.explain {
|
||||
|
|
Loading…
Reference in New Issue