projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Safety commit
[SXSI/xpathcomp.git]
/
results.c
diff --git
a/results.c
b/results.c
index
1f1deda
..
19480fd
100644
(file)
--- a/
results.c
+++ b/
results.c
@@
-184,9
+184,9
@@
static int nextLarger (int *tree, int n, int p, int pos, int pot)
\r
{ int answ;
\r
if (!getBit(tree,pos)) return -1; // no answer
\r
\r
{ int answ;
\r
if (!getBit(tree,pos)) return -1; // no answer
\r
- pot--;
\r
pos = (pos<<1)+1;
\r
if (pos >= n) return 0; // when n is not a power of 2, missing leaves
\r
pos = (pos<<1)+1;
\r
if (pos >= n) return 0; // when n is not a power of 2, missing leaves
\r
+ pot--;
\r
if ((p>>pot) == 0) // p goes left
\r
{ answ = nextLarger(tree,n,p&~(1<<pot),pos,pot);
\r
if (answ != -1) return answ;
\r
if ((p>>pot) == 0) // p goes left
\r
{ answ = nextLarger(tree,n,p&~(1<<pot),pos,pot);
\r
if (answ != -1) return answ;
\r