Issue 189: RBTree::Insert has issue when insert a value already exist
Status:  Fixed
Owner: ----
Closed:  Feb 2013
Reported by wyy...@gmail.com, Jul 18, 2012
After read the code of RedBlack.h, I found the RBTree::Insert has a issue when insert an exist value:

          /*
            Stop working if we inserted a node. This
            check also disallows duplicates in the tree
          */
          if ( q->key== inKey )
          {
 	    q->value = inValue;
            break;
 	  }

When value already exist, it breaks the loop, but at the end of this function it still increased the "size":

      /* Make the root black for simplified logic */
      root->red = 0;
      ++size;



Feb 1, 2013
Project Member #1 gameh...@gmail.com
Hi,
Thanks for the analysis & fix.  I'm not sure that 'size' is being used - where did you notice this issue?
Status: Fixed