mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
clean up some more array iterations
This commit is contained in:
parent
0b98614bea
commit
9b6e504c19
14 changed files with 88 additions and 114 deletions
|
|
@ -345,11 +345,10 @@ static const struct msg_info msg_info[] = {
|
|||
|
||||
static inline const struct msg_info *find_msg_info(uint16_t type, const char *name)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < SPA_N_ELEMENTS(msg_info); i++) {
|
||||
if ((name == NULL && type == msg_info[i].type) ||
|
||||
(name != NULL && spa_streq(name, msg_info[i].name)))
|
||||
return &msg_info[i];
|
||||
SPA_FOR_EACH_ELEMENT_VAR(msg_info, i) {
|
||||
if ((name == NULL && type == i->type) ||
|
||||
(name != NULL && spa_streq(name, i->name)))
|
||||
return i;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,11 +250,10 @@ static const struct cmd_info cmd_info[] = {
|
|||
|
||||
static inline const struct cmd_info *find_cmd_info(uint16_t type, const char *name)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < SPA_N_ELEMENTS(cmd_info); i++) {
|
||||
if ((name == NULL && type == cmd_info[i].type) ||
|
||||
(name != NULL && spa_streq(name, cmd_info[i].name)))
|
||||
return &cmd_info[i];
|
||||
SPA_FOR_EACH_ELEMENT_VAR(cmd_info, i) {
|
||||
if ((name == NULL && type == i->type) ||
|
||||
(name != NULL && spa_streq(name, i->name)))
|
||||
return i;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,11 +67,10 @@ static const struct msg_info msg_info[] = {
|
|||
|
||||
static inline const struct msg_info *find_msg_info(uint16_t type, const char *name)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < SPA_N_ELEMENTS(msg_info); i++) {
|
||||
if ((name == NULL && type == msg_info[i].type) ||
|
||||
(name != NULL && spa_streq(name, msg_info[i].name)))
|
||||
return &msg_info[i];
|
||||
SPA_FOR_EACH_ELEMENT_VAR(msg_info, i) {
|
||||
if ((name == NULL && type == i->type) ||
|
||||
(name != NULL && spa_streq(name, i->name)))
|
||||
return i;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue