From 12f307c1b3b21106008f080f48fcef94a12a64b0 Mon Sep 17 00:00:00 2001 From: djcb Date: Thu, 27 Dec 2012 16:00:13 +0200 Subject: [PATCH] * mu-query: no need for sorting the first query when we do the sorting later --- lib/mu-query.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/mu-query.cc b/lib/mu-query.cc index 4f1fd888..5466d2ca 100644 --- a/lib/mu-query.cc +++ b/lib/mu-query.cc @@ -499,14 +499,15 @@ mu_query_run (MuQuery *self, const char *searchexpr, MuMsgFieldId sortfieldid, * query since we can do it in the second one */ first_flags = inc_related ? (flags & ~MU_QUERY_FLAG_THREADS) : flags; - iter = mu_msg_iter_new ( reinterpret_cast(&enq), maxnum, - sortfieldid, + /* with inc_related, we do the sorting in the + * second query + */ + inc_related ? MU_MSG_FIELD_ID_NONE : sortfieldid, msg_iter_flags (first_flags), err); - /* * if we want related messages, do a second query, * based on the message ids / refs of the first one