From bb17302084192bd06facc5f6501206c3ab21b3a1 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 20 Sep 2018 14:28:47 +0100 Subject: [PATCH] [radix-tree] tidy up _degrade_to_n48 Shouldn't be any functional changes. --- base/data-struct/radix-tree-adaptive.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base/data-struct/radix-tree-adaptive.c b/base/data-struct/radix-tree-adaptive.c index 23e69f842..cd53dd600 100644 --- a/base/data-struct/radix-tree-adaptive.c +++ b/base/data-struct/radix-tree-adaptive.c @@ -597,16 +597,16 @@ static void _degrade_to_n48(struct node256 *n256, struct value *result) unsigned i, count = 0; struct node48 *n48 = zalloc(sizeof(*n48)); - memset(n48->keys, 48, sizeof(n48->keys)); - n48->nr_entries = n256->nr_entries; for (i = 0; i < 256; i++) { if (n256->values[i].type == UNSET) - continue; + n48->keys[i] = 48; - n48->keys[i] = count; - n48->values[count] = n256->values[i]; - count++; + else { + n48->keys[i] = count; + n48->values[count] = n256->values[i]; + count++; + } } free(n256);