From 57a8f99a32316bcb1fb14316745960b40483aad8 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Thu, 2 May 2024 21:35:37 -0400 Subject: [PATCH] fixes --- examples/soak.c | 4 +++- include/sparsemap.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/soak.c b/examples/soak.c index f66728d..48dfed7 100644 --- a/examples/soak.c +++ b/examples/soak.c @@ -541,7 +541,9 @@ verify_sm_is_first_available_span(sparsemap_t *map, sparsemap_idx_t idx, size_t while (sparsemap_is_set(map, i + j) == value && j < len) { j++; } - return i == idx; + if (j == len) { + return i == idx; + } } return false; } diff --git a/include/sparsemap.h b/include/sparsemap.h index db19216..571f431 100644 --- a/include/sparsemap.h +++ b/include/sparsemap.h @@ -289,7 +289,7 @@ void sparsemap_split(sparsemap_t *map, sparsemap_idx_t offset, sparsemap_t *othe * 3 when 0-based). * * @param[in] map The sparsemap reference. - * @param[in] n Specifies how many bits to ignore (when n=3 return the position + * @param[in] n Specifies how many bits to ignore (when n=2 return the position * of the third matching bit). * @param[in] value Determines if the search is to examine set (true) or unset * (false) bits in the bitmap index.