From d87bae5b233e9b47ae5ab8d1a56154e41f53eafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Siedlaczek?= Date: Sat, 18 Nov 2023 03:49:06 -0500 Subject: [PATCH] Remove assert from `next_geq` (#555) --- include/pisa/block_posting_list.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/pisa/block_posting_list.hpp b/include/pisa/block_posting_list.hpp index 471a6fb40..a46ab1a59 100644 --- a/include/pisa/block_posting_list.hpp +++ b/include/pisa/block_posting_list.hpp @@ -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)) {