From fd81d0364cd5b9d9d11b0f4d5e665f3f35b98fff Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Wed, 30 Dec 2015 13:55:08 -0800 Subject: [PATCH] firestorm.indexField() uses capacity of len(tokenFreqs) --- index/firestorm/analysis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index/firestorm/analysis.go b/index/firestorm/analysis.go index c2118ff3..9e9626f6 100644 --- a/index/firestorm/analysis.go +++ b/index/firestorm/analysis.go @@ -94,7 +94,7 @@ func (f *Firestorm) Analyze(d *document.Document) *index.AnalysisResult { func (f *Firestorm) indexField(docID string, docNum uint64, includeTermVectors bool, fieldIndex uint16, fieldLength int, tokenFreqs analysis.TokenFrequencies) []index.IndexRow { - rows := make([]index.IndexRow, 0, 100) + rows := make([]index.IndexRow, 0, len(tokenFreqs)) fieldNorm := float32(1.0 / math.Sqrt(float64(fieldLength))) for _, tf := range tokenFreqs {