pipewire: fix a bugprone-branch-clone warning

A clang-tidy bugprone-branch-clone warning has been fixed and branches
are made more uniform
This commit is contained in:
Doğukan Korkmaztürk 2022-07-11 12:38:42 -04:00
parent c35006f040
commit fd2cc19eaa

View file

@ -826,8 +826,7 @@ bool pw_check_option(const char *option, const char *value)
return global_support.no_color == spa_atob(value);
else if (spa_streq(option, "no-config"))
return global_support.no_config == spa_atob(value);
else
return false;
return false;
}
/** Get the client name
@ -841,15 +840,11 @@ const char *pw_get_client_name(void)
const char *cc;
static char cname[256];
if ((cc = pw_get_application_name()))
if ((cc = pw_get_application_name()) || (cc = pw_get_prgname()))
return cc;
else if ((cc = pw_get_prgname()))
return cc;
else {
if (snprintf(cname, sizeof(cname), "pipewire-pid-%zd", (size_t) getpid()) < 0)
return NULL;
return cname;
}
else if (snprintf(cname, sizeof(cname), "pipewire-pid-%zd", (size_t) getpid()) < 0)
return NULL;
return cname;
}
/** Reverse the direction */