From: Kevin McCarthy Date: Sun, 10 Mar 2019 02:03:52 +0000 (+0800) Subject: Improve imap uid seqset hcache buffer usage. X-Git-Tag: mutt-1-12-rel~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34f77eabea3121be181ed3e61ace6aa09c3cdbd9;p=mutt Improve imap uid seqset hcache buffer usage. mutt_buffer_increase_size() terminates the buffer, so there is no need to explicitly check for an empty buffer after the imap_msn_index_to_uid_seqset() call. --- diff --git a/imap/util.c b/imap/util.c index 3bae9be3..a1977216 100644 --- a/imap/util.c +++ b/imap/util.c @@ -227,7 +227,6 @@ int imap_hcache_del (IMAP_DATA* idata, unsigned int uid) int imap_hcache_store_uid_seqset (IMAP_DATA *idata) { BUFFER *b; - size_t seqset_size; int rc; if (!idata->hcache) @@ -238,12 +237,8 @@ int imap_hcache_store_uid_seqset (IMAP_DATA *idata) mutt_buffer_increase_size (b, HUGE_STRING); imap_msn_index_to_uid_seqset (b, idata); - seqset_size = b->dptr - b->data; - if (seqset_size == 0) - b->data[0] = '\0'; - rc = mutt_hcache_store_raw (idata->hcache, "/UIDSEQSET", - b->data, seqset_size + 1, + b->data, mutt_buffer_len (b) + 1, imap_hcache_keylen); dprint (5, (debugfile, "Stored /UIDSEQSET %s\n", b->data)); mutt_buffer_free (&b);