Skip to content

Commit

Permalink
tree data sorted REFACTOR redundant macros
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed May 29, 2024
1 parent f77ca9c commit a2f2cd8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/tree_data_sorted.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ struct rb_node {
*(RBN) = (const struct rb_node){0}; \
RBN_DNODE(RBN) = DNODE;

/**
* @brief Metadata name of the Red-black tree.
*/
#define RB_NAME "lyds_tree"
#define RB_NAME_LEN strlen(RB_NAME)

/**
* @brief Get red-black root from metadata.
*
Expand Down Expand Up @@ -176,7 +170,7 @@ lyds_get_rb_tree(const struct lyd_node *leader, struct lyd_meta **meta)
*meta = NULL;
}
LY_LIST_FOR(leader->meta, iter) {
if (!strcmp(iter->name, RB_NAME)) {
if (!strcmp(iter->name, "lyds_tree")) {
if (meta) {
*meta = iter;
}
Expand Down Expand Up @@ -1177,7 +1171,7 @@ lyds_create_metadata(struct lyd_node *leader, struct lyd_meta **meta_p)
LY_CHECK_ERR_RET(!modyang, LOGERR(LYD_CTX(leader), LY_EINT, "The yang module is not installed."), LY_EINT);

/* create new metadata, its rbt is NULL */
ret = lyd_create_meta(leader, &meta, modyang, RB_NAME, RB_NAME_LEN, NULL, 0, 0, 1, NULL,
ret = lyd_create_meta(leader, &meta, modyang, "lyds_tree", 9, NULL, 0, 0, 1, NULL,
LY_VALUE_CANON, NULL, LYD_HINT_DATA, NULL, 0, NULL);
LY_CHECK_RET(ret);

Expand Down

0 comments on commit a2f2cd8

Please sign in to comment.