Changeset: e6d920beb43f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e6d920beb43f
Modified Files:
        monetdb5/optimizer/opt_coercion.c
Branch: notepad
Log Message:

coercionOptimizerCalcStep(): improve code more consistent & readbility

always use "getArg(p,X)" instead of "p->argv[X]"
to underline that it is about the same thing

As opposed to poetry or prose, source code is the type of literature
where we usually prefer to always use the same words for expressing
the same thing, rather than creating a large variety.
This consistency supports intelligibility, comprehensibility, ...,
and thus easy maintenance.


[Just collecting my code ideas;
 feel free to graft or merge into the default branch
 as applicable or desired.]


diffs (21 lines):

diff --git a/monetdb5/optimizer/opt_coercion.c 
b/monetdb5/optimizer/opt_coercion.c
--- a/monetdb5/optimizer/opt_coercion.c
+++ b/monetdb5/optimizer/opt_coercion.c
@@ -80,7 +80,7 @@ coercionOptimizerCalcStep(Client cntxt, 
                varid = getArg(p,1);
                getArg(p,1) = coerce[getArg(p,1)].src;
                if ( chkInstruction(NULL, cntxt->nspace, mb, p))
-                       p->argv[1] = varid;
+                       getArg(p,1) = varid;
        }
        if ( b == r && coerce[getArg(p,2)].src &&  coerce[getArg(p,2)].fromtype 
< r ) 
        {
@@ -91,7 +91,7 @@ coercionOptimizerCalcStep(Client cntxt, 
                varid = getArg(p,2);
                getArg(p,2) = coerce[getArg(p,2)].src;
                if ( chkInstruction(NULL, cntxt->nspace, mb, p))
-                       p->argv[2] = varid;
+                       getArg(p,2) = varid;
        }
 #ifdef _DEBUG_COERCION_
                mnstr_printf(cntxt->fdout,"#final instruction\n");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to