Return early in stead of goto
This commit is contained in:
@@ -266,13 +266,11 @@ static bool pipewire_core_version_at_least(int major, int minor, int patch)
|
|||||||
static bool io_list_check_add(struct io_node *node)
|
static bool io_list_check_add(struct io_node *node)
|
||||||
{
|
{
|
||||||
struct io_node *n;
|
struct io_node *n;
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
// See if the node is already in the list
|
// See if the node is already in the list
|
||||||
spa_list_for_each (n, &hotplug_io_list, link) {
|
spa_list_for_each (n, &hotplug_io_list, link) {
|
||||||
if (n->id == node->id) {
|
if (n->id == node->id) {
|
||||||
ret = false;
|
return false;
|
||||||
goto dup_found;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,9 +281,7 @@ static bool io_list_check_add(struct io_node *node)
|
|||||||
SDL_AddAudioDevice(node->recording, node->name, &node->spec, PW_ID_TO_HANDLE(node->id));
|
SDL_AddAudioDevice(node->recording, node->name, &node->spec, PW_ID_TO_HANDLE(node->id));
|
||||||
}
|
}
|
||||||
|
|
||||||
dup_found:
|
return true;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void io_list_remove(Uint32 id)
|
static void io_list_remove(Uint32 id)
|
||||||
|
|||||||
Reference in New Issue
Block a user