Skip to content

Commit a7eef89

Browse files
cmikkreedjc
authored andcommitted
reader: add commentary to index lookup failure case in reader_iter_seek.
1 parent b4521f9 commit a7eef89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mtbl/reader.c

+4
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@ reader_iter_seek(void *v,
416416
block_iter_seek(it->index_iter, key, len_key);
417417

418418
if (!block_iter_get(it->index_iter, &ikey, &len_ikey, &ival, &len_ival)) {
419+
/* This seek puts us after the last key, so we mark the
420+
* iterator as invalid and return success. The next
421+
* mtbl_iter_next() operation will return mtbl_res_failure.
422+
*/
419423
it->valid = false;
420424
return (mtbl_res_success);
421425
}

0 commit comments

Comments
 (0)