Changeset: e26982d3b5d7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e26982d3b5d7
Modified Files:
        gdk/gdk_select.c
Branch: default
Log Message:

No need for orig_s.
This was a leftover from the initial implementation in which s didn't
have to be sorted.


diffs (64 lines):

diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -324,7 +324,6 @@ BATsubselect(BAT *b, BAT *s, const void 
 {
        int hval, lval, equi, t, lnil;
        const void *nil;
-       BAT *orig_s = s;
        BAT *bn;
        BUN estimate;
 
@@ -433,10 +432,7 @@ BATsubselect(BAT *b, BAT *s, const void 
                 * any: i.e. return everything */
                ALGODEBUG fprintf(stderr, 
"#BATsubselect(b=%s#"BUNFMT",s=%s,anti=%d): everything, nonil\n", BATgetId(b), 
BATcount(b), s ? BATgetId(s) : "NULL", anti);
                if (s) {
-                       if (s == orig_s)
-                               return BATcopy(s, TYPE_void, s->ttype, 0);
-                       else
-                               return s; /* already made a copy: return it */
+                       return BATcopy(s, TYPE_void, s->ttype, 0);
                } else {
                        return BATmirror(BATmark(b, 0));
                }
@@ -526,8 +522,6 @@ BATsubselect(BAT *b, BAT *s, const void 
                                o = (oid) high;
                                high = SORTfndfirst(s, &o);
                                v = VIEWhead(BATmirror(s));
-                               if (s != orig_s)
-                                       BBPunfix(s->batCacheid);
                        } else {
                                v = VIEWhead(b); /* [oid,nil] */
                        }
@@ -540,8 +534,6 @@ BATsubselect(BAT *b, BAT *s, const void 
                                o = (oid) high;
                                high = SORTfndfirst(s, &o);
                                v = VIEWhead(BATmirror(s));
-                               if (s != orig_s)
-                                       BBPunfix(s->batCacheid);
                        } else {
                                v = VIEWhead(b); /* [oid,nil] */
                        }
@@ -584,11 +576,8 @@ BATsubselect(BAT *b, BAT *s, const void 
        }
 
        bn = BATnew(TYPE_void, TYPE_oid, estimate);
-       if (bn == NULL) {
-               if (s && s != orig_s)
-                       BBPreclaim(s);
+       if (bn == NULL)
                return NULL;
-       }
 
        if (equi &&
            (b->T->hash ||
@@ -602,9 +591,6 @@ BATsubselect(BAT *b, BAT *s, const void 
                bn = BAT_scanselect(b, s, bn, tl, th, li, hi, equi, anti, lval, 
hval);
        }
 
-       if (bn == NULL && s && s != orig_s)
-               BBPreclaim(s);
-
        return bn;
 }
 
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to