X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fstatic_sequence_wvtree.cpp;h=d5713ce8ae29ca1f84162b6d616cec57cd5a7b1a;hb=4e6e8f179979f24c8f77e11eb8f6cc3d609a52d4;hp=aa6a885572fcf9e68a7003d311c5fe4e48f6bffa;hpb=d4b3b5272a584e67df051a575d8a6a9edd8dee1e;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_sequence/static_sequence_wvtree.cpp b/libcds/src/static_sequence/static_sequence_wvtree.cpp index aa6a885..d5713ce 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree.cpp +++ b/libcds/src/static_sequence/static_sequence_wvtree.cpp @@ -62,7 +62,9 @@ uint static_sequence_wvtree::count(uint s) { } uint static_sequence_wvtree::select(uint symbol, uint pos) { - return root->select(am->map(symbol), pos, 0, c)-1; + uint ret = root->select(am->map(symbol), pos, 0, c); + if(ret==((uint)-1)) return (uint)-1; + return ret-1; } uint static_sequence_wvtree::access(uint pos) {