Skip to content

Commit

Permalink
Remove assert from next_geq (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
elshize authored Nov 18, 2023
1 parent 242c1db commit d87bae5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/pisa/block_posting_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,15 @@ struct block_posting_list {
}
}

/**
* Moves to the next document, counting from the current position,
* with the ID equal to or greater than `lower_bound`.
*
* In particular, if called with a value that is less than or equal
* to the current document ID, the position will not change.
*/
void PISA_ALWAYSINLINE next_geq(uint64_t lower_bound)
{
assert(lower_bound >= m_cur_docid || position() == 0);
if (PISA_UNLIKELY(lower_bound > m_cur_block_max)) {
// binary search seems to perform worse here
if (lower_bound > block_max(m_blocks - 1)) {
Expand Down

0 comments on commit d87bae5

Please sign in to comment.