void BTree::AddKey (const Clave &k)
{
uint left, right;
- Clave *kout;
+ Clave *kout, *in;
+
+ in = k.Clone ();
+ /* TODO : Hacer un contador con recuperacion */
+ in->SetBlockData (0);
try {
- kout = AddKeyR (k.Clone (), 0, left, right);
+ kout = AddKeyR (in->Clone (), 0, left, right);
} catch (Exception *e) {
throw e;
}
+ delete in;
+
if (kout) {
unsigned short level;
/* Debo dejar la raiz en el nodo 0, por lo que paso el nodo
BTreeNodeHeader nh;
std::list<uint>::iterator it;
- it = deleted_nodes.begin ();
- if (it != deleted_nodes.end ()) {
+ if (deleted_nodes.size ()) {
+ it = deleted_nodes.begin ();
num = *it;
deleted_nodes.erase (it);
} else {