From 41e6e875e5e48b9e908b007e246a9ee961e60e24 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 12 Sep 2025 16:33:48 +0200 Subject: [PATCH] spa: clean up the filter code Use SPA_FLAG_IS_SET() and use the same if/else pattern. --- spa/include/spa/pod/filter.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index 836095029..d5fe18d24 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -292,7 +292,7 @@ SPA_API_POD_FILTER int spa_pod_filter_part(struct spa_pod_builder *b, p2 = spa_pod_object_find_prop(of, p2, p1->key); if (p2 != NULL) res = spa_pod_filter_prop(b, p1, p2); - else if ((p1->flags & SPA_POD_PROP_FLAG_MANDATORY) != 0) + else if (SPA_FLAG_IS_SET(p1->flags, SPA_POD_PROP_FLAG_MANDATORY)) res = -EINVAL; else spa_pod_builder_raw_padded(b, p1, SPA_POD_PROP_SIZE(p1)); @@ -305,11 +305,12 @@ SPA_API_POD_FILTER int spa_pod_filter_part(struct spa_pod_builder *b, p1 = spa_pod_object_find_prop(op, p1, p2->key); if (p1 != NULL) continue; - if ((p2->flags & SPA_POD_PROP_FLAG_MANDATORY) != 0) + if (SPA_FLAG_IS_SET(p2->flags, SPA_POD_PROP_FLAG_MANDATORY)) res = -EINVAL; + else + spa_pod_builder_raw_padded(b, p2, SPA_POD_PROP_SIZE(p2)); if (res < 0) break; - spa_pod_builder_raw_padded(b, p2, SPA_POD_PROP_SIZE(p2)); } } spa_pod_builder_pop(b, &f);