Commit 116911945e7f834278abf586c1d4d3a62174858a

Authored by Georg Hopp
1 parent 99ce2633

fix position of TR_TREE_FIND call

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