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