Changeset: 7b3d55142cb7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b3d55142cb7
Modified Files:
gdk/gdk_bat.mx
Branch: Mar2011
Log Message:
Don't use the same iterator twice in one expression.
diffs (45 lines):
diff --git a/gdk/gdk_bat.mx b/gdk/gdk_bat.mx
--- a/gdk/gdk_bat.mx
+++ b/gdk/gdk_bat.mx
@@ -1644,6 +1644,7 @@
idx2 = last;
if (p != last) {
unsigned short hs = Hsize(b), ts = Tsize(b);
+ BATiter bi2 = bat_iterator(b);
@:acc_move(last,p,idx2,idx1)@
/* If a column was sorted before the BUN was
@@ -1655,7 +1656,7 @@
if p+1==last, the new value is now the
last, so no comparison is needed. */
if (b->hsorted & 1) {
- if (p + 1 < last && ATOMcmp(b->htype,
BUNhead(bi, p), BUNhead(bi, p + 1)) > 0) {
+ if (p + 1 < last && ATOMcmp(b->htype,
BUNhead(bi, p), BUNhead(bi2, p + 1)) > 0) {
b->hsorted = FALSE;
b->H->nosorted = idx1;
}
@@ -1664,13 +1665,13 @@
b->H->nodense = idx1;
}
} else if (b->hsorted == (bit) GDK_SORTED_REV) {
- if (p + 1 < last && ATOMcmp(b->htype,
BUNhead(bi, p), BUNhead(bi, p + 1)) < 0) {
+ if (p + 1 < last && ATOMcmp(b->htype,
BUNhead(bi, p), BUNhead(bi2, p + 1)) < 0) {
b->hsorted = FALSE;
b->H->nosorted_rev = idx1;
}
}
if (b->tsorted & 1) {
- if (p + 1 < last && ATOMcmp(b->ttype,
BUNtail(bi, p), BUNtail(bi, p + 1)) > 0) {
+ if (p + 1 < last && ATOMcmp(b->ttype,
BUNtail(bi, p), BUNtail(bi2, p + 1)) > 0) {
b->tsorted = FALSE;
b->H->nosorted = idx1;
}
@@ -1679,7 +1680,7 @@
b->T->nodense = idx1;
}
} else if (b->tsorted == (bit) GDK_SORTED_REV) {
- if (p + 1 < last && ATOMcmp(b->ttype,
BUNtail(bi, p), BUNtail(bi, p + 1)) < 0) {
+ if (p + 1 < last && ATOMcmp(b->ttype,
BUNtail(bi, p), BUNtail(bi2, p + 1)) < 0) {
b->tsorted = FALSE;
b->H->nosorted_rev = idx1;
}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list