Skip to content

Commit

Permalink
remove redundant if statements in avl tree delete_generic()
Browse files Browse the repository at this point in the history
Signed-off-by: Michel van den Hoek <michel.vandenhoek@zettascale.tech>
  • Loading branch information
mvandenhoek committed Dec 4, 2023
1 parent 85261c1 commit 22d89fc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ddsrt/src/avl.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,8 @@ static void delete_generic (const ddsrt_avl_treedef_t *td, ddsrt_avl_tree_t *tre
whence->cs[1]->parent = whence;
}
subst->cs[0] = node->cs[0];
if (subst->cs[0]) {
subst->cs[0]->parent = subst;
}
assert(subst->cs[0] != NULL);
subst->cs[0]->parent = subst;
if (path) {
path->p.pnode[path->p.pnodeidx+1] = &subst->cs[0];
}
Expand All @@ -521,9 +520,8 @@ static void delete_generic (const ddsrt_avl_treedef_t *td, ddsrt_avl_tree_t *tre
subst->parent = node->parent;
subst->height = node->height;
subst->cs[1] = node->cs[1];
if (subst->cs[1]) {
subst->cs[1]->parent = subst;
}
assert(subst->cs[1] != NULL);
subst->cs[1]->parent = subst;
*pnode = subst;
}

Expand Down

0 comments on commit 22d89fc

Please sign in to comment.