aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp
blob: 10c8a914cedaf4443d91c54ed76433ac2f23f09f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "predicate_zero_constraint_posting_list.h"

namespace search::predicate {

PredicateZeroConstraintPostingList::PredicateZeroConstraintPostingList(Iterator it)
    : _iterator(it) {}

bool PredicateZeroConstraintPostingList::next(uint32_t doc_id) {
    if (_iterator.valid() && _iterator.getKey() <= doc_id) {
        _iterator.linearSeek(doc_id + 1);
    }
    if (!_iterator.valid()) {
        return false;
    }
    setDocId(_iterator.getKey());
    return true;
}

}