Skip to content

search: simplify query generator control flow

Administrator requested to merge rvt/lucky-factor-4 into main

Created by: rvantonder

Now that I had a minute to stare at this I finally have a nicer control flow for generation. The generator returns nil only when exhausted, so the pattern from now on is just:

g := NewGenerator(b, rulesNarrow, rulesWiden)
for g != nil {
  autoQ, g = g()
  // stuff
}

Test plan

Covered by existing tests.

Merge request reports

Loading