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

In BATslice, use memcpy when we can for copying a BAT.


diffs (25 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -812,7 +812,20 @@ BATslice(BAT *b, BUN l, BUN h)
                if (bn == NULL) {
                        return bn;
                }
-               if (BAThdense(b) && b->ttype) {
+               if ((bn->htype == TYPE_void || !bn->hvarsized) &&
+                   BATatoms[bn->htype].atomPut == NULL &&
+                   BATatoms[bn->htype].atomFix == NULL &&
+                   (bn->ttype == TYPE_void || !bn->tvarsized) &&
+                   BATatoms[bn->ttype].atomPut == NULL &&
+                   BATatoms[bn->ttype].atomFix == NULL) {
+                       if (bn->htype)
+                               memcpy(Hloc(bn, BUNfirst(bn)), Hloc(b, p),
+                                      (q - p) * Hsize(bn));
+                       if (bn->ttype)
+                               memcpy(Tloc(bn, BUNfirst(bn)), Tloc(b, p),
+                                      (q - p) * Tsize(bn));
+                       BATsetcount(bn, h - l);
+               } else if (BAThdense(b) && b->ttype) {
                        for (; p < q; p++) {
                                bunfastins(bn, NULL, BUNtail(bi, p));
                        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to