summaryrefslogtreecommitdiffstats
path: root/pop.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 /pop.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 'pop.c')
-rw-r--r--pop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pop.c b/pop.c
index 81f739af..a2210d6d 100644
--- a/pop.c
+++ b/pop.c
@@ -632,10 +632,12 @@ static int pop_fetch_message (CONTEXT* ctx, MESSAGE* msg, int msgno)
/* we replace envelop, key in subj_hash has to be updated as well */
if (ctx->subj_hash && h->env->real_subj)
hash_delete (ctx->subj_hash, h->env->real_subj, h, NULL);
+ mutt_label_hash_remove (ctx, h);
mutt_free_envelope (&h->env);
h->env = mutt_read_rfc822_header (msg->fp, h, 0, 0);
if (ctx->subj_hash && h->env->real_subj)
hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
+ mutt_label_hash_add (ctx, h);
h->data = uidl;
h->lines = 0;