From: Kevin McCarthy Date: Wed, 24 May 2017 22:46:41 +0000 (-0700) Subject: Change imap body cache cleanup to use the uid_hash. X-Git-Tag: neomutt-20170526~2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9b005292ccd6a71dd607d3bfceff8f52a2e92cb;p=neomutt Change imap body cache cleanup to use the uid_hash. This should speed up $message_cache_clean cleanup when syncing. --- diff --git a/imap/message.c b/imap/message.c index 5d79a6c7b..27eb6b29e 100644 --- a/imap/message.c +++ b/imap/message.c @@ -125,17 +125,9 @@ static int msg_cache_clean_cb(const char *id, struct BodyCache *bcache, void *da return 0; /* bad UID */ - if (uv != idata->uid_validity) + if (uv != idata->uid_validity || !int_hash_find(idata->uid_hash, uid)) mutt_bcache_del(bcache, id); - /* TODO: presort UIDs, walk in order */ - for (unsigned int n = 0; n < idata->ctx->msgcount; n++) - { - if (uid == HEADER_DATA(idata->ctx->hdrs[n])->uid) - return 0; - } - mutt_bcache_del(bcache, id); - return 0; }