mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: module: use SPA_FOR_EACH_ELEMENT()
Since `module_list` is a fixed-sized array, `SPA_FOR_EACH_ELEMENT()` can be used. So use that. This way there is no need for explicit indexing nor a sentinel at the end.
This commit is contained in:
parent
6aba315b82
commit
4fbe3cbfc6
1 changed files with 6 additions and 5 deletions
|
|
@ -267,16 +267,17 @@ static const struct module_info module_list[] = {
|
|||
#endif
|
||||
{ "module-roc-sink", create_module_roc_sink, },
|
||||
{ "module-roc-source", create_module_roc_source, },
|
||||
{ NULL, }
|
||||
};
|
||||
|
||||
static const struct module_info *find_module_info(const char *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; module_list[i].name != NULL; i++) {
|
||||
if (spa_streq(module_list[i].name, name))
|
||||
return &module_list[i];
|
||||
const struct module_info *info;
|
||||
|
||||
SPA_FOR_EACH_ELEMENT(module_list, info) {
|
||||
if (spa_streq(info->name, name))
|
||||
return info;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue