From: Timo Sirainen Date: Tue, 8 Apr 2025 09:23:48 +0000 (+0300) Subject: lib-settings: Move settings override "*" handling out of the loop X-Git-Tag: 2.4.2~806 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4086cbdcf38331ee9b9fe0a912365bb8699a719;p=thirdparty%2Fdovecot%2Fcore.git lib-settings: Move settings override "*" handling out of the loop This simplifies the code a bit. --- diff --git a/src/lib-settings/settings.c b/src/lib-settings/settings.c index efeced1d54..822b20f0a7 100644 --- a/src/lib-settings/settings.c +++ b/src/lib-settings/settings.c @@ -1792,6 +1792,14 @@ settings_override_filter_match(struct settings_apply_ctx *ctx, set_filter_names->value_type != EVENT_FIELD_VALUE_TYPE_STRLIST) set_filter_names = NULL; + if (set->filter == NULL && + str_begins(set->key, "*"SETTINGS_SEPARATOR_S, &set->key)) { + /* always match, also for any named list filters */ + set->filter_finished = TRUE; + set->always_match = TRUE; + return 1; + } + bool filter_finished = TRUE; string_t *filter_string = NULL; const char *last_filter_key = set->last_filter_key; @@ -1814,12 +1822,6 @@ settings_override_filter_match(struct settings_apply_ctx *ctx, with all filters, which otherwise wouldn't be visible to the settings override code. */ set_type = SET_FILTER_NAME; - } else if (strcmp(part, "*") == 0 && set->filter == NULL) { - /* always match, also for any named list filters */ - set->filter_finished = TRUE; - set->always_match = TRUE; - set->key = p + 1; - return 1; } else { filter_finished = FALSE; break;