Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13938
Modified Files:
opt_replicator.mx
Log Message:
A few minor textual compressions. Double check for conformity needed.
Index: opt_replicator.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_replicator.mx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- opt_replicator.mx 2 Mar 2008 11:46:49 -0000 1.29
+++ opt_replicator.mx 2 Mar 2008 12:08:46 -0000 1.30
@@ -492,43 +492,34 @@
int
findReplica(MalStkPtr s,InstrPtr p)
{
- int i, j, idx, dif = 0;
+ int i, j, idx;
int *vmap;
- InstrPtr *st, q;
- ValPtr pa, qa;
+ InstrPtr q;
if (repl == NULL) return -1;
vmap = getMap(s);
if( vmap == NULL)
GDKerror("Variable map not initialized\n");
- st = repl->stmt;
for (i = 0; i < repl->stop; i++){
- q = st[i];
+ q = getInstrPtr(repl,i);
if((p->argc != q->argc) ||
(getFunctionId(p) != getFunctionId(q)))
continue;
- else{
- dif = 0;
- for (j = 1; j < p->argc; j++){
- idx = p->argv[j];
- if( vmap[idx] >=0 ){ /* symbol comp */
- if( vmap[idx] != getArg(q,j)){
- dif = 1;
- break;
- }
- } else { /* value comp */
- pa = &s->stk[idx];
- qa = &getVar(repl,getArg(q,j))->value;
- if( VALcmp(pa,qa) ){
- dif = 1;
- break;
- }
- }
- }
- if( dif == 0 ) return i;
+
+ for (j = p->retc; j < p->argc; j++){
+ idx = getArg(p,j);
+ if( vmap[idx] >=0 ){ /* symbol comp */
+ if( vmap[idx] != getArg(q,j))
+ goto notfound;
+ } else
+ if( VALcmp(&s->stk[idx],
&getVar(repl,getArg(q,j))->value) )
+ goto notfound;
}
+ /* found a match */
+ return i;
+
+ notfound: continue;
}
-
return -1;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins