mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pulse-server: use for-each loop
Use `SPA_FOR_EACH_ELEMENT` to enumate the elements in the array instead of an "indexed" loop.
This commit is contained in:
parent
3fefb55ef2
commit
4c27c3fd43
1 changed files with 5 additions and 4 deletions
|
|
@ -37,10 +37,11 @@ static const struct extension extensions[] = {
|
|||
|
||||
const struct extension *extension_find(uint32_t idx, const char *name)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < SPA_N_ELEMENTS(extensions); i++) {
|
||||
if (idx == extensions[i].idx || spa_streq(name, extensions[i].name))
|
||||
return &extensions[i];
|
||||
const struct extension *ext;
|
||||
|
||||
SPA_FOR_EACH_ELEMENT(extensions, ext) {
|
||||
if (idx == ext->idx || spa_streq(name, ext->name))
|
||||
return ext;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue