Bug fixes for rankLessThan()
[SXSI/XMLTree.git] / libcds / src / static_sequence / wt_node_leaf.cpp
index 43ca7ca..6c036fd 100644 (file)
@@ -36,17 +36,9 @@ uint wt_node_leaf::rank(uint symbol, uint pos, uint l, wt_coder * c) {
        return pos;
 }
 
-uint wt_node_leaf::rankLessThan(uint &symbol, uint pos, uint l, wt_coder * c) {
-//    std::cout <<"this-symbol: " << (uchar)this->symbol << ", symbol = " << (uchar)symbol << ", pos = " << pos << std::endl;
-       if(symbol > this->symbol) return -1;
-        symbol = this->symbol;
-       pos++;
-       return pos;
-}
-
 uint wt_node_leaf::rankLessThan(uint &symbol, uint pos) {
 //    std::cout <<"this-symbol: " << (uchar)this->symbol << ", symbol = " << (uchar)symbol << ", pos = " << pos << std::endl;
-    if (pos == (uint)-1)
+    if (pos == (uint)-1 || symbol < this->symbol)
         return -1;
     symbol = this->symbol;
     pos++;