matchtree: Do not pass Stats in newMatchTree
It is not used in the construction of a match tree.
Change-Id: I1de5d49d45e70e1369ad86bc9838d67cab9283fe
diff --git a/eval.go b/eval.go
index 271c4e2..7ab81a9 100644
--- a/eval.go
+++ b/eval.go
@@ -117,7 +117,7 @@
q = query.Map(q, query.ExpandFileContent)
- mt, err := d.newMatchTree(q, &res.Stats)
+ mt, err := d.newMatchTree(q)
if err != nil {
return nil, err
}
diff --git a/matchtree.go b/matchtree.go
index 165c309..5ce7069 100644
--- a/matchtree.go
+++ b/matchtree.go
@@ -477,7 +477,7 @@
return len(t.current) > 0, true
}
-func (d *indexData) newMatchTree(q query.Q, stats *Stats) (matchTree, error) {
+func (d *indexData) newMatchTree(q query.Q) (matchTree, error) {
switch s := q.(type) {
case *query.Regexp:
subQ := query.RegexpToQuery(s.Regexp, ngramSize)
@@ -489,7 +489,7 @@
return q
})
- subMT, err := d.newMatchTree(subQ, stats)
+ subMT, err := d.newMatchTree(subQ)
if err != nil {
return nil, err
}
@@ -512,7 +512,7 @@
case *query.And:
var r []matchTree
for _, ch := range s.Children {
- ct, err := d.newMatchTree(ch, stats)
+ ct, err := d.newMatchTree(ch)
if err != nil {
return nil, err
}
@@ -522,7 +522,7 @@
case *query.Or:
var r []matchTree
for _, ch := range s.Children {
- ct, err := d.newMatchTree(ch, stats)
+ ct, err := d.newMatchTree(ch)
if err != nil {
return nil, err
}
@@ -530,13 +530,13 @@
}
return &orMatchTree{r}, nil
case *query.Not:
- ct, err := d.newMatchTree(s.Child, stats)
+ ct, err := d.newMatchTree(s.Child)
return ¬MatchTree{
child: ct,
}, err
case *query.Substring:
- return d.newSubstringMatchTree(s, stats)
+ return d.newSubstringMatchTree(s)
case *query.Branch:
mask := uint64(0)
@@ -575,7 +575,7 @@
}, nil
case *query.Symbol:
- mt, err := d.newSubstringMatchTree(s.Atom, stats)
+ mt, err := d.newSubstringMatchTree(s.Atom)
if err != nil {
return nil, err
}
@@ -595,7 +595,7 @@
return nil, nil
}
-func (d *indexData) newSubstringMatchTree(s *query.Substring, stats *Stats) (matchTree, error) {
+func (d *indexData) newSubstringMatchTree(s *query.Substring) (matchTree, error) {
st := &substrMatchTree{
query: s,
caseSensitive: s.CaseSensitive,