X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/4582a22e254c682b0e91750725401d018c9e93f2..bb83fdaa6e234bff23810b22fca3a098e2afb975:/src/btree_data.cpp?ds=inline diff --git a/src/btree_data.cpp b/src/btree_data.cpp index b95b86a..7ba3448 100644 --- a/src/btree_data.cpp +++ b/src/btree_data.cpp @@ -26,7 +26,7 @@ uint BTreeData::Size () const { uint s = sizeof (uint); if (clave) s += clave->Size (); - + else std::cout << "No tengo clave\n"; return s; } @@ -43,9 +43,17 @@ uchar* BTreeData::ToArray () const bool BTreeData::operator < (const BTreeData &data) const { + if (!data.clave) return false; + return (*clave) < (*(data.clave)); } +bool BTreeData::operator == (const BTreeData &data) const +{ + if (!data.clave) return false; + + return (*clave) == (*(data.clave)); +} BTreeLeafData::~BTreeLeafData () { @@ -53,7 +61,6 @@ BTreeLeafData::~BTreeLeafData () uint BTreeLeafData::Size () const { - std::cout << "BTreeLeafData::Size()" << std::endl; if (!clave) { std::cout << "BTreeLeafData::Size : No tengo clave!" << std::endl; return 0; @@ -77,7 +84,6 @@ BTreeChildData::~BTreeChildData () uint BTreeChildData::Size () const { - std::cout << "BTreeChildData::Size()" << std::endl; return sizeof (uint); }