From a18b3d324f2861666872bd3cdf2e5db1583044cf Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 13 Jun 2021 11:22:57 -0400 Subject: Avoid performing a SEARCH for ALL --- archive.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'archive.c') diff --git a/archive.c b/archive.c index 20ea5d0..4c0e9da 100644 --- a/archive.c +++ b/archive.c @@ -136,6 +136,17 @@ static void searchThreads( struct Resp resp; struct List roots = {0}; + if (!strcmp(expr, "ALL")) { + for (size_t i = 0; i < threads.len; ++i) { + struct Data root = { + .type = Number, + .number = threadRoot(dataCheck(threads.ptr[i], List).list) + }; + listPush(&roots, root); + } + goto concat; + } + enum Atom search = atom("search"); concatSearch(imap->w, search, threads, expr); for (; resp = respOk(imapResp(imap)), resp.tag != search; respFree(resp)) { @@ -145,6 +156,7 @@ static void searchThreads( } respFree(resp); +concat: concatIndex(name, roots, threads, envelopes); listFree(roots); } -- cgit 1.4.1