summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
82b89c8)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@218
3cdefd35-fc62-479d-8e8d-
bae585ffb9ca
uint wt_node_internal::select(uint symbol, uint pos, uint l, wt_coder * c) {
bool is_set = c->is_set(symbol, l);
uint wt_node_internal::select(uint symbol, uint pos, uint l, wt_coder * c) {
bool is_set = c->is_set(symbol, l);
if(!is_set) {
if(left_child==NULL)
return (uint)(-1);
uint new_pos = left_child->select(symbol, pos, l+1,c);
if(new_pos+1==0) return (uint)(-1);
if(!is_set) {
if(left_child==NULL)
return (uint)(-1);
uint new_pos = left_child->select(symbol, pos, l+1,c);
if(new_pos+1==0) return (uint)(-1);
- return bitmap->select0(new_pos)+1;
+ ret = bitmap->select0(new_pos)+1;
} else {
if(right_child==NULL)
return (uint)(-1);
uint new_pos = right_child->select(symbol, pos, l+1,c);
if(new_pos+1==0) return (uint)(-1);
} else {
if(right_child==NULL)
return (uint)(-1);
uint new_pos = right_child->select(symbol, pos, l+1,c);
if(new_pos+1==0) return (uint)(-1);
- return bitmap->select1(new_pos)+1;
+ ret = bitmap->select1(new_pos)+1;
+ if(ret==0) return (uint)-1;
+ return ret;
}
uint wt_node_internal::access(uint pos) {
}
uint wt_node_internal::access(uint pos) {