X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fquery.cc;h=b5f1546ac084d609b24a25a60dd68e677f513145;hb=c3c0966521a4d9e04281ae9ee0abcc33ace67c47;hp=4b4c80f4d5f952d3340ce495c1c2583b984d76ca;hpb=e4a7c2b8703280e93b205965d7df1b7dda8a0bf7;p=notmuch diff --git a/lib/query.cc b/lib/query.cc index 4b4c80f4..b5f1546a 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -231,12 +231,12 @@ notmuch_query_search_threads (notmuch_query_t *query, threads_seen++; } - if (thread) - _notmuch_thread_add_message (thread, message); - notmuch_message_destroy (message); messages_seen++; + + if (max_threads >= 0 && threads_seen >= first + max_threads) + break; } /* Stop if we're not seeing any more messages. */