From 9c721ff3f72b676158652bf7e588ec740b393150 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 23 Nov 2015 15:16:12 -0800 Subject: [PATCH] faster asserts --- src/core/support/avl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/support/avl.c b/src/core/support/avl.c index 7b67637520f..98e728818a2 100644 --- a/src/core/support/avl.c +++ b/src/core/support/avl.c @@ -76,7 +76,6 @@ static long calculate_height(gpr_avl_node *node) { return node == NULL ? 0 : 1 + GPR_MAX(calculate_height(node->left), calculate_height(node->right)); } -#endif static gpr_avl_node *assert_invariants(gpr_avl_node *n) { if (n == NULL) return NULL; @@ -86,6 +85,11 @@ static gpr_avl_node *assert_invariants(gpr_avl_node *n) { assert(labs(node_height(n->left) - node_height(n->right)) <= 1); return n; } +#else +static gpr_avl_node *assert_invariants(gpr_avl_node *n) { + return n; +} +#endif gpr_avl_node *new_node(void *key, void *value, gpr_avl_node *left, gpr_avl_node *right) {