int32_t ORMatcher_advance(ORMatcher *self, int32_t target) { if (!self->size) { return 0; } do { int32_t least = SI_top_advance(self, target); if (least >= target) { return least; } if (!least) { if (!self->size) { return 0; } } } while (true); }
int32_t ORMatcher_Advance_IMP(ORMatcher *self, int32_t target) { ORMatcherIVARS *const ivars = ORMatcher_IVARS(self); if (!ivars->size) { return 0; } do { int32_t least = SI_top_advance(self, ivars, target); if (least >= target) { return least; } if (!least) { if (!ivars->size) { return 0; } } } while (true); }
int32_t ORScorer_advance(ORScorer *self, int32_t target) { // Return sentinel once exhausted. if (!self->size) { return 0; } // Succeed if we're already past and still on a valid doc. if (target <= self->doc_id) { return self->doc_id; } do { // If all matchers are caught up, accumulate score and return. if (self->top_hmd->doc >= target) { return S_advance_after_current(self); } // Not caught up yet, so keep skipping matchers. if (!SI_top_advance((ORMatcher*)self, target)) { if (!self->size) { return 0; } } } while (true); }