diff options
| -rw-r--r-- | tree.c | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -62,10 +62,9 @@ tree_insert(struct tree_node *tree, T key) | |||
| 62 | struct tree_node * | 62 | struct tree_node * |
| 63 | tree_insert_it(struct tree_node *root, T key) | 63 | tree_insert_it(struct tree_node *root, T key) |
| 64 | { | 64 | { |
| 65 | struct tree_node *parent = NULL, | 65 | struct tree_node *parent = NULL; |
| 66 | *curr = root; | ||
| 67 | 66 | ||
| 68 | while ( curr != NULL ) { | 67 | for ( struct tree_node *curr = root; curr != NULL; ) { |
| 69 | parent = curr; | 68 | parent = curr; |
| 70 | 69 | ||
| 71 | if ( key < curr->key ) { | 70 | if ( key < curr->key ) { |
