Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16:/tmp/cvs-serv3201/runtime

Modified Files:
        prec_foll.mx 
Log Message:
stream-lined implementation of following step:
eliminated extra branch by merging early-out condition
with loop condition


Declaration/disclaimer:
-----------------------
On my FC6 desktop (64-bit, 64-bit OIDs, configured with --enable-optimize,
compiled with gcc 4.1.1), this check-in does not make any pathfinder test
fail that did not also fail with the most recent code base in CVS prior to
this check-in.
I did not check in detail, though, whether all previously failing tests
still fail the same way after this check-in as they did before this
check-in.



Index: prec_foll.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/prec_foll.mx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- prec_foll.mx        3 Jan 2007 12:33:12 -0000       1.14
+++ prec_foll.mx        13 May 2007 11:42:34 -0000      1.15
@@ -99,20 +99,17 @@
     @:init(following)@
 
     BATloopFast(doc_pre, p, q, xx) {
-        oid cur_following = INT_MAX;
         oid boundary = *(oid*) BUNtail(doc_pre,p);
-        boundary += size[boundary] + 1;
+        oid cur_following = boundary += size[boundary] + 1;
 
         /* within the fragment (boundary), go over all context nodes */
-        while(ctx_cur < ctx_end && *ctx_cur < boundary) { 
+        while(ctx_cur < ctx_end && *ctx_cur < cur_following /*<= boundary*/) { 
             /* new following is the first following node of the current 
context node */
             oid new_following = *ctx_cur + size[*ctx_cur] + 1;
 
             if (new_following < cur_following) {
                 cur_following = new_following; /* keep setting cur_following 
back */
             }
-            /* if we overtake the cur_following, we cannot set it back 
anymore: generate results */
-            if (cur_following < *ctx_cur) break;
             ctx_cur += ctx_nxt;
         }
         while(ctx_cur < ctx_end && *ctx_cur < boundary) { 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to