Refactor: Move nexus children init from node_insert to node_new

parent 9015c6d0
......@@ -234,6 +234,8 @@ node_new(struct pesi *pesi, enum n_type type, enum n_state state)
AN(node);
node->type = type;
node->state = state;
if (type == T_NEXUS)
VSTAILQ_INIT(&node->nexus.children);
return (node);
}
......@@ -333,8 +335,6 @@ node_insert(const struct bytes_tree *tree, struct node *parent,
AZ(node->parent);
node->parent = parent;
if (node->type == T_NEXUS)
VSTAILQ_INIT(&node->nexus.children);
VSTAILQ_INSERT_TAIL(&parent->nexus.children, node, sibling);
......
......@@ -641,7 +641,6 @@ root_node_new(struct pesi *pesi, struct req *req)
root_node->nexus.req = req;
root_node->nexus.gzip.magic = NEXUS_GZIP_MAGIC;
root_node->nexus.npending_private = 1;
VSTAILQ_INIT(&root_node->nexus.children);
return (root_node);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment