X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/8699d7e1ccbda4282f8ba693422f337be31d100b..0997831a9dd5e4359fc70f7f7ff59c1a97132ddc:/src/btree.cpp?ds=sidebyside diff --git a/src/btree.cpp b/src/btree.cpp index 4d28e49..093377b 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -131,7 +131,6 @@ Clave* BTree::AddKeyR (const Clave *k, uint node_num, uint &left_child, uint &ri if ((*data) < (*datait)) /* Me pase, lo agrego aca! */ break; - it++; } node_keys.insert (it, data); WriteKeys (node, node_header, node_keys); @@ -250,6 +249,7 @@ std::list BTree::ReadKeys (uchar *node, BTreeNodeHeader &node_heade { std::list keys; node += sizeof (BTreeNodeHeader); + uint count = node_header.item_count; if (node_header.item_count == 0) return keys; @@ -258,9 +258,10 @@ std::list BTree::ReadKeys (uchar *node, BTreeNodeHeader &node_heade BTreeChildData *d = new BTreeChildData (node); node += d->Size (); keys.push_back (d); + count--; } - for (uint i=0; i