X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fquery.cc;h=381529b538c270695144d4aef8ae7ba673dee996;hp=4b4c80f4d5f952d3340ce495c1c2583b984d76ca;hb=bbf4b8e4aec69b5684587b77bd0af743afd61eb1;hpb=e4a7c2b8703280e93b205965d7df1b7dda8a0bf7 diff --git a/lib/query.cc b/lib/query.cc index 4b4c80f4..381529b5 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -237,6 +237,9 @@ notmuch_query_search_threads (notmuch_query_t *query, 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. */