projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
network plugin: Avoid "status may be used uninitialized" warning.
[collectd.git]
/
src
/
utils_avltree.c
diff --git
a/src/utils_avltree.c
b/src/utils_avltree.c
index
f71b1fd
..
6a25fb5
100644
(file)
--- a/
src/utils_avltree.c
+++ b/
src/utils_avltree.c
@@
-613,10
+613,18
@@
int c_avl_pick (c_avl_tree_t *t, void **key, void **value)
n = t->root;
while ((n->left != NULL) || (n->right != NULL))
{
n = t->root;
while ((n->left != NULL) || (n->right != NULL))
{
- int height_left = (n->left == NULL) ? 0 : n->left->height;
- int height_right = (n->right == NULL) ? 0 : n->right->height;
+ if (n->left == NULL)
+ {
+ n = n->right;
+ continue;
+ }
+ else if (n->right == NULL)
+ {
+ n = n->left;
+ continue;
+ }
- if (
height_left > height_r
ight)
+ if (
n->left->height > n->right->he
ight)
n = n->left;
else
n = n->right;
n = n->left;
else
n = n->right;