Skip to content

Commit ec50156

Browse files
committed
Improve docs.
1 parent ffa4b35 commit ec50156

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ bool *bool_array = malloc((range_end - range_start) * sizeof(bool));
829829
roaring_bitmap_range_bool_array(r1, range_start, range_end, bool_array);
830830
831831
// The bool_array now contains true/false for elements at positions [range_start, range_end)
832-
// bool_array[i] is true if the (range_start+i)-th element exists in the bitmap
832+
// bool_array[i] is true if the (range_start+i) exists in the bitmap
833833
834834
// you must free the memory:
835835
free(bool_array);

include/roaring/containers/bitset.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,6 @@ int bitset_container_to_uint32_array(uint32_t *out,
397397
const bitset_container_t *bc,
398398
uint32_t base);
399399

400-
/*
401-
* Write out the 16-bit integers contained in this container as a list of 8-bit
402-
* booleans using base as the starting value (it might be expected that base has
403-
* zeros in its 16 least significant bits). The function returns the number of
404-
* values written. The caller is responsible for allocating enough memory in
405-
* out. The out pointer should point to enough memory (the cardinality times 8
406-
* bits).
407-
*/
408-
409400
/*
410401
* Print this container using printf (useful for debugging).
411402
*/

include/roaring/containers/containers.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,15 +2478,19 @@ bool container_iterator_read_into_uint64(const container_t *c, uint8_t typecode,
24782478
uint16_t *value_out);
24792479

24802480
/**
2481-
* Reads entries until the the first entry whose value is greater than or equal
2482-
* to `*max_value` from the container, and sets corresponding positions in `buf`
2483-
* to true. If `max_value` is null, then all entries are read.
2484-
* The `buf` array is filled starting from index 0, which corresponds
2485-
* to the current iterator position `it`. For subsequent iterator positions
2486-
* `it_new`, set `buf[it_new->current_value - it->current_value]` to true.
2481+
* Reads entries until the the last entry whose value is strictly smaller than
2482+
* `*max_value` from the container (*max_value is excluded), and sets
2483+
* corresponding positions in `buf` to true. If `max_value` is null, then all
2484+
* entries are read.
2485+
*
2486+
* The `buf` array is filled starting from index 0, which corresponds to the
2487+
* initial iterator position `it`. For subsequent iterator positions `it_new`,
2488+
* set `buf[it_new->current_value - it->current_value]` to true.
2489+
*
24872490
* Returns true and sets `value_out` if a value is present after reading the
24882491
* entries.
2489-
* The initial `it` should has value.
2492+
*
2493+
* The initial `it` should have a value.
24902494
*/
24912495
bool container_iterator_read_into_bool(const container_t *c, uint8_t typecode,
24922496
roaring_container_iterator_t *it,

include/roaring/roaring.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,8 @@ bool roaring_bitmap_to_bitset(const roaring_bitmap_t *r, bitset_t *bitset);
567567
*
568568
* ans = malloc((range_end - range_start) * sizeof(bool));
569569
*
570-
* For more control, see `roaring_uint32_iterator_skip` and
571-
* `roaring_uint32_iterator_read_to_bool`, which can be used to e.g. tell how
572-
* many values were actually read.
570+
* For more control, see `roaring_uint32_iterator_move_equalorlarger` and
571+
* `roaring_uint32_iterator_read_into_bool`.
573572
*/
574573
void roaring_bitmap_range_bool_array(const roaring_bitmap_t *r,
575574
uint32_t range_start, uint32_t range_end,
@@ -1228,14 +1227,14 @@ uint32_t roaring_uint32_iterator_read(roaring_uint32_iterator_t *it,
12281227
uint32_t *buf, uint32_t count);
12291228

12301229
/**
1231-
* Reads until the first value that is greater than or equal to ${max_value} and
1230+
* Reads until the last value that is strictly smaller than `max_value` and
12321231
* fill the bool array `buf`.
12331232
*
12341233
* This function satisfies semantics of iteration and can be used together with
12351234
* other iterator functions.
1236-
* - buf[0] will be set to true.
1237-
* - let `it1` be the initial iterator, and for every iterated `it`,
1238-
* buf[it1.current_value - it.current_value] will be set to true; other
1235+
*
1236+
* Let `it1` be the initial iterator and it has value, then for every iterated
1237+
* `it`, buf[it1.current_value - it.current_value] will be set to true; other
12391238
* positions will remain to be false.
12401239
* - after function returns, iterator is positioned at the next element
12411240
*/

0 commit comments

Comments
 (0)