Showing
1 changed file
with
2 additions
and
2 deletions
| ... | ... | @@ -30,8 +30,6 @@ TR_treeInsert(TR_Tree * this, const void * search, TR_TreeComp comp) |
| 30 | 30 | TR_Tree new_node = NULL; |
| 31 | 31 | int found; |
| 32 | 32 | |
| 33 | - TR_TREE_FIND(node, search, found, comp); | |
| 34 | - | |
| 35 | 33 | /* |
| 36 | 34 | * insert the node or return the one in tree if comparison |
| 37 | 35 | * succeeds. |
| ... | ... | @@ -43,6 +41,8 @@ TR_treeInsert(TR_Tree * this, const void * search, TR_TreeComp comp) |
| 43 | 41 | */ |
| 44 | 42 | *this = node = new_node = TR_new(TR_Tree, search); |
| 45 | 43 | } else { |
| 44 | + TR_TREE_FIND(node, search, found, comp); | |
| 45 | + | |
| 46 | 46 | if (found == 0) { |
| 47 | 47 | // we found an element |
| 48 | 48 | // as this is insert and not find this will overwrite an existing | ... | ... |
Please
register
or
login
to post a comment