From b04bffa5a9325403d3f5dc324ac3264d3b5694d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 12 Jun 2021 14:47:44 +0200 Subject: [PATCH] pipewire: properties: use for-each loop Use spa_dict_for_each instead of open-coding the loop. --- src/pipewire/properties.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pipewire/properties.c b/src/pipewire/properties.c index 095d92883..4543005b8 100644 --- a/src/pipewire/properties.c +++ b/src/pipewire/properties.c @@ -125,15 +125,14 @@ struct pw_properties *pw_properties_new(const char *key, ...) SPA_EXPORT struct pw_properties *pw_properties_new_dict(const struct spa_dict *dict) { - uint32_t i; + const struct spa_dict_item *it; struct properties *impl; impl = properties_new(SPA_ROUND_UP_N(dict->n_items, 16)); if (impl == NULL) return NULL; - for (i = 0; i < dict->n_items; i++) { - const struct spa_dict_item *it = &dict->items[i]; + spa_dict_for_each(it, dict) { if (it->key != NULL && it->key[0] && it->value != NULL) add_func(&impl->this, strdup(it->key), strdup(it->value));