0
0
Fork 0

optimize disjunction scorer to avoid locations alloc if unneeded

This commit is contained in:
Steve Yen 2016-09-22 18:19:18 -07:00
parent 988dfb02e9
commit 647a039a6f
1 changed files with 1 additions and 1 deletions

View File

@ -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 {