0
0
Fork 0

remove duplicate code suggested by review from @steveyen

This commit is contained in:
Marty Schoch 2017-01-31 15:12:06 -05:00
parent a3ee71ddbb
commit 12a7257b5f
1 changed files with 7 additions and 8 deletions

View File

@ -97,20 +97,19 @@ func (s *PhraseSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch,
}
for s.currMust != nil {
// check this match against phrase constraints
rv := s.checkCurrMustMatch(ctx)
if rv != nil {
// prepare for next iteration
err := s.advanceNextMust(ctx)
if err != nil {
return nil, err
}
return rv, nil
}
// prepare for next iteration (either loop or subsequent call to Next())
err := s.advanceNextMust(ctx)
if err != nil {
return nil, err
}
// if match satisfied phrase constraints return it as a hit
if rv != nil {
return rv, nil
}
}
return nil, nil