From dd6c8ae38f70277130662423a7eb6d7c132088a7 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Tue, 22 Jan 2013 08:54:57 +0200 Subject: [PATCH] card: Remove some unnecessary checks. --- src/pulsecore/card.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index 3077193a6..afabc9531 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -181,20 +181,16 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) { /* As a minor optimization we just steal the list instead of * copying it here */ - c->profiles = data->profiles; + pa_assert_se(c->profiles = data->profiles); data->profiles = NULL; - c->ports = data->ports; + pa_assert_se(c->ports = data->ports); data->ports = NULL; - if (c->profiles) { - PA_HASHMAP_FOREACH(profile, c->profiles, state) - profile->card = c; - } + PA_HASHMAP_FOREACH(profile, c->profiles, state) + profile->card = c; - if (c->ports) { - PA_HASHMAP_FOREACH(port, c->ports, state) - port->card = c; - } + PA_HASHMAP_FOREACH(port, c->ports, state) + port->card = c; c->active_profile = NULL; c->save_profile = FALSE;