Changeset: 18a16d5d7618 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18a16d5d7618
Modified Files:
        monetdb5/optimizer/opt_costModel.c
Branch: default
Log Message:

OPTcostModelImplementation(): clean-up conditions to avoid useless arithmetics


diffs (25 lines):

diff --git a/monetdb5/optimizer/opt_costModel.c 
b/monetdb5/optimizer/opt_costModel.c
--- a/monetdb5/optimizer/opt_costModel.c
+++ b/monetdb5/optimizer/opt_costModel.c
@@ -108,10 +108,10 @@ OPTcostModelImplementation(Client cntxt,
                        } else if (getFunctionId(p) == deleteRef){
                                if( isaBatType(getArgType(mb,p,2)) ){
                                        /* delete BAT */
-                                       newRows(1,2, (c1 - c2 ==0? 1: c1-c2),1);
+                                       newRows(1, 2, (c2 == c1 ? 1 : c1 - c2), 
1);
                                } else {
                                        /* insert scalars */
-                                       newRows(1,1, (c1==1?1: c1-1),1);
+                                       newRows(1, 1, (c1 == 1 ? 1 : c1 - 1), 
1);
                                }
                        } else if (getFunctionId(p) == insertRef){
                                newRows(1,1,( c1 + 1),0); /* faked */
@@ -127,7 +127,7 @@ OPTcostModelImplementation(Client cntxt,
                                getFunctionId(p) == minRef ||
                                getFunctionId(p) == maxRef ||
                                getFunctionId(p) == avgRef) {
-                               newRows(1,1, ( c1?c1:c1+1),0);
+                               newRows(1, 1, (c1 != 0 ? c1 : 1), 0);
                        } else  if (getFunctionId(p) == countRef){
                                newRows(1,1, 1,0);
                        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to