mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
virdnsmasq: Drop @binaryPath argument from dnsmasqCapsNewEmpty()
Both callers of dnsmasqCapsNewEmpty() pass DNSMASQ as an argument which is then fed to a ternary operator which looks like this (after substitution). DNSMASQ ? DNSMASQ : DNSMASQ While I like tautologies, the code can be simplified by dropping the argument. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
ce20fe5c2a
commit
a7ffa2a647
@ -700,7 +700,7 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps, bool force)
|
||||
}
|
||||
|
||||
static dnsmasqCaps *
|
||||
dnsmasqCapsNewEmpty(const char *binaryPath)
|
||||
dnsmasqCapsNewEmpty(void)
|
||||
{
|
||||
dnsmasqCaps *caps;
|
||||
|
||||
@ -708,14 +708,14 @@ dnsmasqCapsNewEmpty(const char *binaryPath)
|
||||
return NULL;
|
||||
if (!(caps = virObjectNew(dnsmasqCapsClass)))
|
||||
return NULL;
|
||||
caps->binaryPath = g_strdup(binaryPath ? binaryPath : DNSMASQ);
|
||||
caps->binaryPath = g_strdup(DNSMASQ);
|
||||
return caps;
|
||||
}
|
||||
|
||||
dnsmasqCaps *
|
||||
dnsmasqCapsNewFromBuffer(const char *buf)
|
||||
{
|
||||
dnsmasqCaps *caps = dnsmasqCapsNewEmpty(DNSMASQ);
|
||||
dnsmasqCaps *caps = dnsmasqCapsNewEmpty();
|
||||
|
||||
if (!caps)
|
||||
return NULL;
|
||||
@ -730,7 +730,7 @@ dnsmasqCapsNewFromBuffer(const char *buf)
|
||||
dnsmasqCaps *
|
||||
dnsmasqCapsNewFromBinary(void)
|
||||
{
|
||||
dnsmasqCaps *caps = dnsmasqCapsNewEmpty(DNSMASQ);
|
||||
dnsmasqCaps *caps = dnsmasqCapsNewEmpty();
|
||||
|
||||
if (!caps)
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user