From: Kevin McCarthy Date: Thu, 5 Jan 2017 03:45:59 +0000 (-0800) Subject: Fix imap server-side search to call uid2msgno() only once. (see #3905) X-Git-Tag: mutt-1-8-rel~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2388b3d5011ab08a7e1f5e8546350e914271704;p=mutt 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. --- 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; } }