Browse Source

[2811] Don't call rebalance for subtree roots

Mukund Sivaraman 12 years ago
parent
commit
c386d06ac5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/lib/datasrc/memory/domaintree.h

+ 3 - 1
src/lib/datasrc/memory/domaintree.h

@@ -1864,11 +1864,13 @@ DomainTree<T>::insert(util::MemorySegment& mem_sgmt,
     } else if (order < 0) {
         node->setSubTreeRoot(false);
         parent->left_ = node;
+        insertRebalance(current_root, node);
     } else {
         node->setSubTreeRoot(false);
         parent->right_ = node;
+        insertRebalance(current_root, node);
     }
-    insertRebalance(current_root, node);
+
     if (new_node != NULL) {
         *new_node = node;
     }