clean up some more array iterations

This commit is contained in:
Wim Taymans 2022-09-30 17:23:05 +02:00
parent 0b98614bea
commit 9b6e504c19
14 changed files with 88 additions and 114 deletions

View file

@ -553,11 +553,10 @@ static const struct object_info *objects[] =
static const struct object_info *find_info(const char *type, uint32_t version)
{
size_t i;
for (i = 0; i < SPA_N_ELEMENTS(objects); i++) {
if (spa_streq(objects[i]->type, type) &&
objects[i]->version <= version)
return objects[i];
SPA_FOR_EACH_ELEMENT_VAR(objects, i) {
if (spa_streq((*i)->type, type) &&
(*i)->version <= version)
return *i;
}
return NULL;
}