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

@ -1241,11 +1241,10 @@ static const struct class *classes[] =
static const struct class *find_class(const char *type, uint32_t version)
{
size_t i;
for (i = 0; i < SPA_N_ELEMENTS(classes); i++) {
if (spa_streq(classes[i]->type, type) &&
classes[i]->version <= version)
return classes[i];
SPA_FOR_EACH_ELEMENT_VAR(classes, c) {
if (spa_streq((*c)->type, type) &&
(*c)->version <= version)
return *c;
}
return NULL;
}