summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb7fed8)
raw | patch | inline | side by side (parent: cb7fed8)
author | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Wed, 14 Feb 2007 21:44:45 +0000 (22:44 +0100) | ||
committer | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Wed, 14 Feb 2007 21:44:45 +0000 (22:44 +0100) |
src/utils_avltree.c | patch | blob | history |
diff --git a/src/utils_avltree.c b/src/utils_avltree.c
index 4763d234716de7705d7a57af3c5490b4a512a4f9..830b711f8f9713d45bfe5b898995b2ac5f85b7ae 100644 (file)
--- a/src/utils_avltree.c
+++ b/src/utils_avltree.c
return (avl_create_iterator (t, n));
} /* avl_iterator_t *avl_get_iterator */
-int avl_pick (avl_tree_t *, void **key, void **value)
+int avl_pick (avl_tree_t *t, void **key, void **value)
{
avl_node_t *n;
avl_node_t *p;
n = t->root;
while ((n->left != NULL) || (n->right != NULL))
{
- int height_left = (n->left == NULL) ? 0 : n->left->traffic;
- int height_right = (n->right == NULL) ? 0 : n->right->traffic;
+ int height_left = (n->left == NULL) ? 0 : n->left->height;
+ int height_right = (n->right == NULL) ? 0 : n->right->height;
if (height_left > height_right)
n = n->left;
*value = n->value;
free_node (n);
- rebalance (p);
+ rebalance (t, p);
return (0);
} /* int avl_pick */