//grow tree
{
- void *prev = NULL, *newleaf = leaf;
-
+ void *prev=NULL, *newleaf=leaf;
//find where to store
- for(leaf=root; leaf && leaf->__key <= newkey ; leaf=leaf->__next)
+ for(leaf=root; leaf && leaf->__key<=newkey ; leaf=leaf->__next)
{
- prev = leaf;
- if(leaf->__seek && leaf->__seek->key <= newkey) leaf=leaf->__seek;
+ prev=leaf;
+ if(leaf->__seek && leaf->__seek->key<=newkey) leaf=leaf->__seek;
}
-
//store new node
+ leaf=newleaf;
if(prev)
{
-
+ leaf->__next=prev->__next->__next;
+ prev->__next=leaf;
}
else
- {
-
- }
+ leaf->__next=root;
+ //auto seek
+ if(leaf->__next->__next;)
+ leaf->__seek=leaf->__next->__next;
//reindex B+ tree
for(leaf=root; leaf->__next ; leaf=leaf->__next)