diff --git a/include/import/eb32tree.h b/include/import/eb32tree.h index 9b331f609..54fb52260 100644 --- a/include/import/eb32tree.h +++ b/include/import/eb32tree.h @@ -309,9 +309,6 @@ __eb32_insert(struct eb_root *root, struct eb32_node *new) { * would sit on different branches). */ - // note that if EB_NODE_BITS > 1, we should check that it's still >= 0 - new->node.bit = flsnz(new->key ^ old->key) - EB_NODE_BITS; - if (new->key == old->key) { new->node.bit = -1; /* mark as new dup tree, just in case */ @@ -330,6 +327,10 @@ __eb32_insert(struct eb_root *root, struct eb32_node *new) { } /* otherwise fall through */ } + else { + /* note that if EB_NODE_BITS > 1, we should check that it's still >= 0 */ + new->node.bit = flsnz(new->key ^ old->key) - EB_NODE_BITS; + } if (new->key >= old->key) { new->node.branches.b[EB_LEFT] = troot; @@ -446,9 +447,6 @@ __eb32i_insert(struct eb_root *root, struct eb32_node *new) { * would sit on different branches). */ - // note that if EB_NODE_BITS > 1, we should check that it's still >= 0 - new->node.bit = flsnz(new->key ^ old->key) - EB_NODE_BITS; - if (new->key == old->key) { new->node.bit = -1; /* mark as new dup tree, just in case */ @@ -467,6 +465,10 @@ __eb32i_insert(struct eb_root *root, struct eb32_node *new) { } /* otherwise fall through */ } + else { + /* note that if EB_NODE_BITS > 1, we should check that it's still >= 0 */ + new->node.bit = flsnz(new->key ^ old->key) - EB_NODE_BITS; + } if ((s32)new->key >= (s32)old->key) { new->node.branches.b[EB_LEFT] = troot;