Changeset: e6e32756ad31 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e6e32756ad31
Modified Files:
        monetdb5/modules/kernel/bat5.c
Branch: default
Log Message:

Simplify code.


diffs (38 lines):

diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -216,27 +216,18 @@ BKCmirror(bat *ret, const bat *bid)
 {
        BAT *b, *bn;
 
+       *ret = 0;
        if ((b = BATdescriptor(*bid)) == NULL) {
                throw(MAL, "bat.mirror", RUNTIME_OBJECT_MISSING);
        }
        bn = BATdense(b->hseqbase, b->hseqbase, BATcount(b));
-       if (bn != NULL) {
-               if (b->batRestricted == BAT_WRITE) {
-                       BAT *bn1;
-                       bn1 = COLcopy(bn, bn->ttype, FALSE, TRANSIENT);
-                       BBPreclaim(bn);
-                       bn = bn1;
-               }
-               if (bn != NULL) {
-                       *ret = bn->batCacheid;
-                       BBPkeepref(*ret);
-                       BBPunfix(b->batCacheid);
-                       return MAL_SUCCEED;
-               }
+       BBPunfix(b->batCacheid);
+       if (bn == NULL) {
+               throw(MAL, "bat.mirror", GDK_EXCEPTION);
        }
-       *ret = 0;
-       BBPunfix(b->batCacheid);
-       throw(MAL, "bat.mirror", GDK_EXCEPTION);
+       *ret = bn->batCacheid;
+       BBPkeepref(*ret);
+       return MAL_SUCCEED;
 }
 
 char *
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to