Skip to content

Commit 202a6ff

Browse files
committed
feat radix: when tree is empty first/last will get offset 0
Signed-off-by: John Sanpe <sanpeqf@gmail.com>
1 parent 493e94e commit 202a6ff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/radix.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ bfdev_radix_root_first(bfdev_radix_root_t *root, uintptr_t *offsetp)
327327
bfdev_radix_node_t *node;
328328
uintptr_t offset;
329329

330+
*offsetp = 0;
330331
node = root->node;
331332
level = root->level;
332333

@@ -354,6 +355,7 @@ bfdev_radix_root_last(bfdev_radix_root_t *root, uintptr_t *offsetp)
354355
bfdev_radix_node_t *node;
355356
uintptr_t offset;
356357

358+
*offsetp = 0;
357359
node = root->node;
358360
level = root->level;
359361

0 commit comments

Comments
 (0)