From 5db2c6cc32ad0f9fcfa63dfe98585f79893cc2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Mon, 31 Jan 2022 12:31:54 +0100 Subject: [PATCH] pulse-server: simplify a condition `a || (!a && b)` equals `a || b` due to the short-circuiting nature of `||` and `&&`. --- src/modules/module-protocol-pulse/pulse-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 2b82308a2..469cc8d84 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -2159,7 +2159,7 @@ static int do_finish_upload_stream(struct client *client, uint32_t command, uint channel, name); struct sample *old = find_sample(impl, SPA_ID_INVALID, name); - if (old == NULL || (old != NULL && old->ref > 1)) { + if (old == NULL || old->ref > 1) { sample = calloc(1, sizeof(*sample)); if (sample == NULL) goto error_errno;