diff options
author | Joe Thornber <ejt@redhat.com> | 2018-09-20 14:28:47 +0100 |
---|---|---|
committer | Joe Thornber <ejt@redhat.com> | 2018-09-20 14:28:47 +0100 |
commit | bb17302084192bd06facc5f6501206c3ab21b3a1 (patch) | |
tree | ec6df0445aa7fdd1e779f5341f6c641d75a84c00 /base | |
parent | ebd2d7773f2531bd5dddb97c061ddb74af117844 (diff) | |
download | lvm2-bb17302084192bd06facc5f6501206c3ab21b3a1.tar.gz |
[radix-tree] tidy up _degrade_to_n48
Shouldn't be any functional changes.
Diffstat (limited to 'base')
-rw-r--r-- | base/data-struct/radix-tree-adaptive.c | 12 |
1 files 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); |