[evolution-data-server] libebook: Preserve predicate-order of sexps
- From: Mathias Hasselmann <hasselmm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] libebook: Preserve predicate-order of sexps
- Date: Thu, 7 Feb 2013 08:39:37 +0000 (UTC)
commit b4a706bd246babdcfe250b73599fb2e19080f99e
Author: Mathias Hasselmann <mathias openismus com>
Date: Wed Feb 6 19:10:57 2013 +0100
libebook: Preserve predicate-order of sexps
When parsing conjunction and disjunction expressions the predicate order
got reversed, which breaks any optimizations that utilize lazy evaluation
or summary access patterns.
I am pretty sure I've fixed this once already.
No idea how to fix got lost.
addressbook/libebook/e-book-query.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index f72d991..8519c1b 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -426,16 +426,23 @@ func_n_ary (EBookQueryNAry make_query,
qs = g_new0 (EBookQuery *, argc);
- for (i = 0; i < argc; i++) {
+ for (i = argc - 1; i >= 0; --i) {
GList *list_head = *list;
- if (!list_head)
- break;
+
+ if (!list_head) {
+ g_free (qs);
+
+ r = e_sexp_result_new (f, ESEXP_RES_BOOL);
+ r->value.boolean = TRUE;
+
+ return r;
+ }
+
qs[i] = list_head->data;
*list = g_list_delete_link(*list, list_head);
}
*list = g_list_prepend(*list, make_query (argc, qs, TRUE));
-
g_free (qs);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]