]> sourceware.org Git - lvm2.git/commitdiff
[radix-tree] tidy up _degrade_to_n48
authorJoe Thornber <ejt@redhat.com>
Thu, 20 Sep 2018 13:28:47 +0000 (14:28 +0100)
committerJoe Thornber <ejt@redhat.com>
Thu, 20 Sep 2018 13:28:47 +0000 (14:28 +0100)
Shouldn't be any functional changes.

base/data-struct/radix-tree-adaptive.c

index 23e69f8424d3b0dbc3d625fc5bab7d3ee0afd5f0..cd53dd6005620dfc4f1b0a584f399f41d91e100a 100644 (file)
@@ -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);
This page took 0.036391 seconds and 5 git commands to generate.