X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fwt_node_internal.cpp;h=16dc441715ad4f0a0ed8743e38f9065d1623b03b;hb=06201fcce6255906ad6b4d305b8e643c634780a3;hp=50bb35f9e5757742cde72653e888fb6720542376;hpb=0412eaf977e4ef67f68db6ded4f1cee0e12cee4f;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_sequence/wt_node_internal.cpp b/libcds/src/static_sequence/wt_node_internal.cpp index 50bb35f..16dc441 100644 --- a/libcds/src/static_sequence/wt_node_internal.cpp +++ b/libcds/src/static_sequence/wt_node_internal.cpp @@ -134,8 +134,8 @@ wt_node_internal::wt_node_internal(uchar * symbols, uint n, uint l, wt_coder * c } else { right_child = NULL; } -// delete [] left; // already deleted -// delete [] right; + delete [] left; // already deleted if count_left > 0 + delete [] right; } @@ -183,7 +183,7 @@ uint wt_node_internal::rankLessThan(uint &symbol, uint pos, uint l, wt_coder * c // cout << "recursion to leftchild at l = " << l << ", symbol = " << (uchar)symbol << ", rank0 = " << bitmap->rank0(pos) << ", rank1 = " << bitmap->rank1(pos) << endl; // check left child for symbols <= givenSymbol - if (result != -1 || left_child == NULL) + if (result != (uint)-1 || left_child == NULL) return result; return left_child->rankLessThan(symbol, bitmap->rank0(pos)-1); } @@ -195,11 +195,11 @@ uint wt_node_internal::rankLessThan(uint &symbol, uint pos) using std::endl; // cout << "pos = " << pos << ", symbol = " << (uchar)symbol << endl; - if (pos == -1) - return -1; + if (pos == (uint)-1) + return (uint)-1; if(right_child!=NULL) result = right_child->rankLessThan(symbol, bitmap->rank1(pos)-1); - if(result == -1 && left_child!=NULL) + if(result == (uint)-1 && left_child!=NULL) return left_child->rankLessThan(symbol, bitmap->rank0(pos)-1); return result; }