Various cleanups
[SXSI/xpathcomp.git] / 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
-    pot--;\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