Skip to content

Commit

Permalink
fix(avl): inline the max macro
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiDood committed Oct 14, 2024
1 parent f64b384 commit 8661662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/avl-tree/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ptrdiff_t node_balance(const struct Node * const self) {
void node_recompute_height(struct Node * const self) {
const ptrdiff_t left = node_height(self->left);
const ptrdiff_t right = node_height(self->right);
self->height = 1 + max(left, right);
self->height = 1 + (left < right ? right : left);
}

struct Node * node_l_rotate(struct Node * const self) {
Expand Down

0 comments on commit 8661662

Please sign in to comment.