Improve pos of rset_create_or
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 21 Nov 2012 10:25:48 +0000 (11:25 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 21 Nov 2012 10:25:48 +0000 (11:25 +0100)
Simply subtract 1 from cur in sum calculation since there's a look
ahead in the rsmultiandor algorithm. Makes a nice improvement
in hit count (reducing ratio in fact).

rset/rsmultiandor.c

index 2ff6e23..f65039a 100644 (file)
@@ -630,7 +630,8 @@ static void r_pos_x(RSFD rfd, double *current, double *total, int and_op)
         }
         else
         {
-            sum_cur += cur;
+            if (cur > 0)
+                sum_cur += (cur - 1);
             sum_tot += tot;
         }
     }