locate first span of length 'n' using rank and select #3

Merged
greg merged 10 commits from gburd/locate-first-span into main 2024-04-07 20:38:57 +00:00
Showing only changes of commit e9128a8422 - Show all commits

View file

@ -1187,14 +1187,9 @@ size_t
sparsemap_span(sparsemap_t *map, size_t loc, size_t len)
{
size_t size = 1024;
// size_t size = sparsemap_get_size(map);
// assert(size >= SM_SIZEOF_OVERHEAD);
// if (loc + 1 > size - len || len < size) {
// return size;
// }
do {
size_t nth = sparsemap_select(map, loc, len);
size_t nth = sparsemap_select(map, len);
size_t count = sparsemap_rank(map, nth - len, nth);
if (count == len) {
return nth - len;