projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New (faster) representation for tags added; faster construction of parentheses
[SXSI/XMLTree.git]
/
libcds
/
src
/
static_sequence
/
wt_node_leaf.cpp
diff --git
a/libcds/src/static_sequence/wt_node_leaf.cpp
b/libcds/src/static_sequence/wt_node_leaf.cpp
index
e3b7c19
..
d99ea62
100644
(file)
--- a/
libcds/src/static_sequence/wt_node_leaf.cpp
+++ b/
libcds/src/static_sequence/wt_node_leaf.cpp
@@
-31,20
+31,18
@@
wt_node_leaf::wt_node_leaf() {}
wt_node_leaf::~wt_node_leaf() {}
uint wt_node_leaf::rank(uint symbol, uint pos, uint l, wt_coder * c) {
wt_node_leaf::~wt_node_leaf() {}
uint wt_node_leaf::rank(uint symbol, uint pos, uint l, wt_coder * c) {
-
assert(symbol==this->symbol)
;
+
if(symbol!=this->symbol) return 0
;
pos++;
pos++;
- assert(pos<=count);
return pos;
}
uint wt_node_leaf::select(uint symbol, uint pos, uint l, wt_coder * c) {
return pos;
}
uint wt_node_leaf::select(uint symbol, uint pos, uint l, wt_coder * c) {
-
assert(symbol==this->symbol)
;
-
assert(pos<=count && pos>0)
;
+
if(symbol!=this->symbol) return (uint)-1
;
+
if(pos==0 || pos>count) return (uint)-1
;
return pos;
}
uint wt_node_leaf::access(uint pos) {
return pos;
}
uint wt_node_leaf::access(uint pos) {
- assert(pos<count);
return symbol;
}
return symbol;
}