diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/support/avl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/support/avl.c b/src/core/support/avl.c index 28b4eb9f42..9734c9987f 100644 --- a/src/core/support/avl.c +++ b/src/core/support/avl.c @@ -206,9 +206,9 @@ static gpr_avl_node *add(const gpr_avl_vtable *vtable, gpr_avl_node *node, if (cmp == 0) { return new_node(key, value, ref_node(node->left), ref_node(node->right)); } else if (cmp > 0) { - return rebalance(vtable, vtable->copy_key(node->key), - vtable->copy_value(node->value), - add(vtable, node->left, key, value), ref_node(node->right)); + return rebalance( + vtable, vtable->copy_key(node->key), vtable->copy_value(node->value), + add(vtable, node->left, key, value), ref_node(node->right)); } else { return rebalance(vtable, vtable->copy_key(node->key), vtable->copy_value(node->value), ref_node(node->left), @@ -253,11 +253,13 @@ static gpr_avl_node *remove(const gpr_avl_vtable *vtable, gpr_avl_node *node, } else if (node->left->height < node->right->height) { gpr_avl_node *h = in_order_head(node->right); return rebalance(vtable, vtable->copy_key(h->key), - vtable->copy_value(h->value), ref_node(node->left), remove(vtable, node->right, h->key)); + vtable->copy_value(h->value), ref_node(node->left), + remove(vtable, node->right, h->key)); } else { gpr_avl_node *h = in_order_tail(node->left); - return rebalance(vtable, vtable->copy_key(h->key), - vtable->copy_value(h->value), remove(vtable, node->left, h->key), ref_node(node->right)); + return rebalance( + vtable, vtable->copy_key(h->key), vtable->copy_value(h->value), + remove(vtable, node->left, h->key), ref_node(node->right)); } } else if (cmp > 0) { return rebalance(vtable, vtable->copy_key(node->key), |