Changeset: bd7f2296c5ea for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd7f2296c5ea
Modified Files:
        monetdb5/extras/crackers/crackers_core_unordered.mx
        monetdb5/extras/crackers/crackers_select_ops.mx
Branch: holindex
Log Message:

Check if batcount is 0 + use 1 less variable (isLess).


diffs (43 lines):

diff --git a/monetdb5/extras/crackers/crackers_core_unordered.mx 
b/monetdb5/extras/crackers/crackers_core_unordered.mx
--- a/monetdb5/extras/crackers/crackers_core_unordered.mx
+++ b/monetdb5/extras/crackers/crackers_core_unordered.mx
@@ -1595,7 +1595,6 @@ static str CRKscan_x_@2_@1 (
        lng t0, t1;
        BUN ReadCursor = first;
        BUN WriteCursor = 0;
-       BUN  isLessThan;
        @1  *src_t = (@1 *) Tloc(buffer, BUNfirst(buffer));
        @1  *src_t_output = (@1 *) Tloc(outputbuffer, BUNfirst(outputbuffer));
 
@@ -1604,8 +1603,7 @@ static str CRKscan_x_@2_@1 (
        t0 = GDKusec();
        for (ReadCursor = first; ReadCursor <= last; ReadCursor++){
                src_t_output[WriteCursor] = src_t[ReadCursor];
-               isLessThan = (src_t[ReadCursor] @7 pivot);
-               WriteCursor += isLessThan;
+               WriteCursor += (src_t[ReadCursor] @7 pivot);
        }
        t1 = GDKusec();
        *ta = (t1 - t0) / 1000.0;
diff --git a/monetdb5/extras/crackers/crackers_select_ops.mx 
b/monetdb5/extras/crackers/crackers_select_ops.mx
--- a/monetdb5/extras/crackers/crackers_select_ops.mx
+++ b/monetdb5/extras/crackers/crackers_select_ops.mx
@@ -1145,11 +1145,13 @@ CRKRangeParallelScan_@1(int *vid, int *b
        ob = BATnew(TYPE_void, b->ttype,BATcount(b));
        assert(ob);
 
-       if (*inclusiveHgh == TRUE)
-               CRKparallelscan_LE_@1(b, ob, *hgh, (BUN) 0, BATcount(b)-1, 
nthreads);
-       else
-               CRKparallelscan_RE_@1(b, ob, *hgh, (BUN) 0, BATcount(b)-1, 
nthreads);
-
+       if(BATcount(b) > 0)
+       {
+               if (*inclusiveHgh == TRUE)
+                       CRKparallelscan_LE_@1(b, ob, *hgh, (BUN) 0, 
BATcount(b)-1, nthreads);
+               else
+                       CRKparallelscan_RE_@1(b, ob, *hgh, (BUN) 0, 
BATcount(b)-1, nthreads);
+       }
 
        BBPunfix(b->batCacheid);
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to