From: Takashi Sakamoto Date: Sun, 15 Nov 2020 14:04:32 +0000 (+0900) Subject: timer: instance_param: simplify count check X-Git-Tag: v0.1.99~34 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=7accd5105f6d3079dc4437eccbf3b2972d88b02e;p=alsa-gobject.git timer: instance_param: simplify count check Usually, when creating list of something, count decision at first, then generate items of the list. At last, the number of items is checked as the same as the count. However, it's unlikely to have different number of items. This commit simplifies the count check. Signed-off-by: Takashi Sakamoto --- diff --git a/src/timer/instance-params.c b/src/timer/instance-params.c index b19382c..1de2a8a 100644 --- a/src/timer/instance-params.c +++ b/src/timer/instance-params.c @@ -223,10 +223,7 @@ void alsatimer_instance_params_get_event_filter(ALSATimerInstanceParams *self, } } - if (index != count) { - g_free(list); - g_return_if_reached(); - } + g_warn_if_fail(index == count); *entries = list; *entry_count = count;