summaryrefslogtreecommitdiffstats
path: root/mbox.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-01-28 18:48:08 -0800
committerKevin McCarthy <kevin@8t8.us>2017-01-28 18:48:08 -0800
commit9ae62494d8315234b48618301bc88d31b65f297e (patch)
treeda7d55f61f98f947171cb676f1d0295e04c847d7 /mbox.c
parentf58e89c8466b36d11ecabddc8baf9727f59e6d69 (diff)
Improve the label completion hash table usage.
Move the hash table inside the Context. Hook message arrival/deletion to update the label hash. Change the label hash to strdup keys. Use hash_find_elem when updating the counter, to reduce unnecessary add/delete operations.
Diffstat (limited to 'mbox.c')
-rw-r--r--mbox.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mbox.c b/mbox.c
index 37f426d8..74affebc 100644
--- a/mbox.c
+++ b/mbox.c
@@ -1198,6 +1198,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
hash_destroy (&ctx->id_hash, NULL);
if (ctx->subj_hash)
hash_destroy (&ctx->subj_hash, NULL);
+ hash_destroy (&ctx->label_hash, NULL);
mutt_clear_threads (ctx);
FREE (&ctx->v2r);
if (ctx->readonly)
@@ -1225,6 +1226,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
ctx->changed = 0;
ctx->id_hash = NULL;
ctx->subj_hash = NULL;
+ mutt_make_label_hash (ctx);
switch (ctx->magic)
{