From a2388b3d5011ab08a7e1f5e8546350e914271704 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Wed, 4 Jan 2017 19:45:59 -0800 Subject: [PATCH] Fix imap server-side search to call uid2msgno() only once. (see #3905) After performing a UID SEARCH, the results are parsed in cmd_parse_search(). This was accidentally calling uid2msgno() twice. Since that function does a linear search, this has a noticable impact on large search results. --- imap/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imap/command.c b/imap/command.c index 4d34d242..2c6f25c1 100644 --- a/imap/command.c +++ b/imap/command.c @@ -884,7 +884,7 @@ static void cmd_parse_search (IMAP_DATA* idata, const char* s) msgno = uid2msgno (idata, uid); if (msgno >= 0) - idata->ctx->hdrs[uid2msgno (idata, uid)]->matched = 1; + idata->ctx->hdrs[msgno]->matched = 1; } } -- 2.40.0