0
0
Fork 0

subsequent calls to advance on the same key

should keep returning the same thing
only increment on initial call
This commit is contained in:
Marty Schoch 2014-04-24 16:08:28 -06:00
parent 55644a695d
commit 0be5cffd21
1 changed files with 3 additions and 1 deletions

View File

@ -183,7 +183,9 @@ func (reader *mockTermFieldReader) Next() (*index.TermFieldDoc, error) {
func (reader *mockTermFieldReader) Advance(ID string) (*index.TermFieldDoc, error) {
reader.curr += 1
if reader.curr < 0 {
reader.curr += 1
}
if reader.curr >= len(reader.sortedDocIds) {
return nil, nil
}