From aacd458b921f2d4f44d5ca9658a1e8c4283dd683 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 17 Apr 2023 10:34:38 +0200 Subject: [PATCH] conf: shortcut failure As soon as we find a failed match, break the loop so that we don't check uselessly the other properties but that we proceeed to the next set of properties to match. --- src/pipewire/conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index db3982b95..e4a4336a4 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -634,8 +634,10 @@ static bool find_match(struct spa_json *arr, const struct spa_dict *props) match++; pw_log_debug("'%s' match '%s' < > '%.*s'", key, str, len, value); } - else + else { fail++; + break; + } } if (match > 0 && fail == 0) return true;