Skip to content

Commit 94f3758

Browse files
oliveredungnx-teko
authored andcommitted
Fix to improve search result collection
1 parent fbc0c0a commit 94f3758

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ arthurgustin [@arthurgustin](https://github.com/arthurgustin)
3232
Bas van Dijk [@basvandijk](https://github.com/basvandijk)
3333
Benjamin Fernandes [@LotharSee](https://github.com/LotharSee)
3434
Benjamin Zarzycki [@kf6nux](https://github.com/kf6nux)
35+
bestgopher [@bestgopher](https://github.com/bestgopher)
3536
Björn Gerdau [@kernle32dll](https://github.com/kernle32dll)
3637
Boris Popovschi [@Zyqsempai](https://github.com/Zyqsempai)
3738
Bowei Xu [@vancexu](https://github.com/vancexu)

search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ func (r *SearchResult) Each(typ reflect.Type) []interface{} {
691691
if r.Hits == nil || r.Hits.Hits == nil || len(r.Hits.Hits) == 0 {
692692
return nil
693693
}
694-
var slice []interface{}
694+
slice := make([]interface{}, 0, len(r.Hits.Hits))
695695
for _, hit := range r.Hits.Hits {
696696
v := reflect.New(typ).Elem()
697697
if hit.Source == nil {

0 commit comments

Comments
 (0)