From 6ced2a50056acbf7caec404a1edfa3b07fa1ac5d Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 29 Dec 2021 10:48:03 +0100 Subject: feat: remove NULL-checks --- avl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'avl.c') diff --git a/avl.c b/avl.c index 13a3d5f..0dfe6ca 100644 --- a/avl.c +++ b/avl.c @@ -34,7 +34,7 @@ insert_r(T x, struct tree_node *p, bool *h) *h = true; p = malloc(sizeof *p); - if ( p != NULL ) { + if ( p ) { p->left = NULL; p->right = NULL; p->bal = 0; @@ -215,7 +215,7 @@ balanceR(struct tree_node *p, bool *h) static void del(struct tree_node **q, struct tree_node **r, bool *h) { - if ( (*r)->right != NULL ) { + if ( (*r)->right ) { del(q, &(*r)->right, h); if ( *h ) *r = balanceR(*r, h); -- cgit v1.3