From b9b005292ccd6a71dd607d3bfceff8f52a2e92cb Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Wed, 24 May 2017 15:46:41 -0700 Subject: [PATCH] Change imap body cache cleanup to use the uid_hash. This should speed up $message_cache_clean cleanup when syncing. --- imap/message.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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; } -- 2.40.0