From 583704c848689d6621e811e28e0014e11d141933 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Wed, 15 Nov 2006 12:54:47 +0100 Subject: [PATCH] small optims. Signed-off-by: Pierre Habouzit --- configure.ac | 1 + muttlib.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 9431e6b..7bc00b3 100644 --- a/configure.ac +++ b/configure.ac @@ -634,6 +634,7 @@ fi # libiconv dnl -- locales -- +AC_CHECK_HEADERS(locale.h) AC_CHECK_HEADERS(wchar.h) AC_CHECK_HEADERS(wctype.h) AC_CHECK_FUNCS(iswalnum iswalpha iswcntrl iswdigit) diff --git a/muttlib.c b/muttlib.c index 7e89aff..fbd4564 100644 --- a/muttlib.c +++ b/muttlib.c @@ -435,16 +435,15 @@ void mutt_set_parameter (const char *attribute, const char *value, void mutt_delete_parameter (const char *attribute, PARAMETER ** p) { - PARAMETER *q; + while (*p) { + if (!ascii_strcasecmp(attribute, (*p)->attribute)) { + PARAMETER *q = parameter_list_pop(p); + parameter_delete(&q); + return; + } - for (q = *p; q; p = &q->next, q = q->next) { - if (ascii_strcasecmp (attribute, q->attribute) == 0) { - *p = q->next; - q->next = NULL; - parameter_list_wipe(&q); - return; + p = &(*p)->next; } - } } /* returns 1 if Mutt can't display this type of data, 0 otherwise */ -- 2.20.1