]> granicus.if.org Git - mutt/commitdiff
Fix imap server-side search to call uid2msgno() only once. (see #3905)
authorKevin McCarthy <kevin@8t8.us>
Thu, 5 Jan 2017 03:45:59 +0000 (19:45 -0800)
committerKevin McCarthy <kevin@8t8.us>
Thu, 5 Jan 2017 03:45:59 +0000 (19:45 -0800)
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

index 4d34d2426fa2cca7ce053a47e8fa9e2c81ebb223..2c6f25c1d9c78327d2a58c9a1678fa4648ad962d 100644 (file)
@@ -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;
   }
 }