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.
This commit is contained in:
Wim Taymans 2023-04-17 10:34:38 +02:00
parent 27bc60aeab
commit aacd458b92

View file

@ -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;