Skip to content

Commit

Permalink
[radix-tree] Fix bug in _dump
Browse files Browse the repository at this point in the history
Values in an n48 were not being printed in the correct order.
  • Loading branch information
jthornber committed Sep 20, 2018
1 parent abe2210 commit 0ac7913
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions base/data-struct/radix-tree-adaptive.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,9 +1260,10 @@ static void _dump(FILE *out, struct value v, unsigned indent)
fprintf(out, "%x ", i);
fprintf(out, ">\n");

for (i = 0; i < 256; i++)
if (n48->keys[i] < 48)
_dump(out, n48->values[i], indent + 1);
for (i = 0; i < n48->nr_entries; i++) {
assert(n48->values[i].type != UNSET);
_dump(out, n48->values[i], indent + 1);
}
break;

case NODE256:
Expand Down

0 comments on commit 0ac7913

Please sign in to comment.