Changeset: afde20aed56e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afde20aed56e
Modified Files:
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/mat.h
        monetdb5/modules/mal/mat.mal
Branch: default
Log Message:

Remove redundant instruction


diffs (99 lines):

diff --git a/monetdb5/modules/mal/mat.c b/monetdb5/modules/mal/mat.c
--- a/monetdb5/modules/mal/mat.c
+++ b/monetdb5/modules/mal/mat.c
@@ -370,70 +370,6 @@ MATpack2(Client cntxt, MalBlkPtr mb, Mal
        return MATpack2Internal(stk,p);
 }
 
-/*
- * the next one is specific to the centipede, where we carve out
- * a portion of table based on the value ids. They are simply glued
- * together in a void-headed bat.
- * The special case that only one partition is filled is taken separately.
-*/
-static str
-MATpack3Internal(MalStkPtr stk, InstrPtr p)
-{
-       int i,*ret, nonempty=0, ref=0, type =0;
-       BAT *b, *bn;
-       BUN cap=0;
-
-       for(i = 1; i < p->argc; i++){
-               b= BATdescriptor(stk->stk[getArg(p,i)].val.ival);
-               if( b == NULL)
-                       throw(MAL, "mat.pack", RUNTIME_OBJECT_MISSING);
-               type= b->ttype; /* all tail types are the same */
-               cap += BATcount(b);
-               nonempty += (BATcount(b) != 0);
-               if ( BATcount(b)) 
-                       ref = i;
-               BBPunfix(b->batCacheid);
-       }
-       if ( nonempty == 1) {
-               b= BATdescriptor(stk->stk[getArg(p,ref)].val.ival);
-               if( b == NULL)
-                       throw(MAL, "mat.pack", RUNTIME_OBJECT_MISSING);
-               if ( b->htype == TYPE_void && b->hseqbase == 0 ) {
-                       /* steal the BAT */
-                       ret= (int*) getArgReference(stk,p,0);
-                       BBPkeepref(*ret = b->batCacheid);
-                       return MAL_SUCCEED;
-               } 
-               bn = BATcopy(b, TYPE_void, type, TRUE);
-               BBPreleaseref(b->batCacheid);
-       } else {
-               bn = BATnew( TYPE_void, type, cap);
-               for( i = 1; bn && i < p->argc; i++){
-                       b= BATdescriptor(stk->stk[getArg(p,i)].val.ival);
-                       if( b == NULL){
-                               BBPreleaseref(bn->batCacheid);
-                               throw(MAL, "mat.pack", RUNTIME_OBJECT_MISSING);
-                       }
-                       BATappend(bn,b,FALSE);
-                       BBPreleaseref(b->batCacheid);
-               }
-       }
-       if( bn == NULL)
-               throw(MAL, "mat.pack", MAL_MALLOC_FAIL);
-       BATseqbase(bn,0);
-       ret= (int*) getArgReference(stk,p,0);
-       BBPkeepref(*ret = bn->batCacheid);
-       return MAL_SUCCEED;
-}
-
-str
-MATpack3(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
-{
-       (void) cntxt;
-       (void) mb;
-       return MATpack3Internal(stk,p);
-}
-
 str
 MATpack(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
 {
diff --git a/monetdb5/modules/mal/mat.h b/monetdb5/modules/mal/mat.h
--- a/monetdb5/modules/mal/mat.h
+++ b/monetdb5/modules/mal/mat.h
@@ -38,7 +38,6 @@
 mat_export str MATpack(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 mat_export str MATmergepack(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
 mat_export str MATpack2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
-mat_export str MATpack3(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 mat_export str MATpackIncrement(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
 mat_export str MATpackValues(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
 mat_export str MATpackSlice(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
diff --git a/monetdb5/modules/mal/mat.mal b/monetdb5/modules/mal/mat.mal
--- a/monetdb5/modules/mal/mat.mal
+++ b/monetdb5/modules/mal/mat.mal
@@ -38,10 +38,6 @@ pattern pack2(b:bat[:oid,:any_2]...):bat
 address MATpack2
 comment "Materialize the MAT into a BAT (by an append all)";
 
-pattern pack3(b:bat[:oid,:any_2]...):bat[:oid,:any_2]
-address MATpack3
-comment "Materialize the MAT into a BAT by considering the heads as void. 
(used in centipede)";
-
 pattern packIncrement(b:bat[:oid,:any_2],pieces:int):bat[:oid,:any_2]
 address MATpackIncrement
 comment "Prepare incremental mat pack";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to