From f157c7d0d37c44205f17acead2dbbecc5e996dae Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 25 May 2022 14:41:25 +0100 Subject: [PATCH] gparamspecs: Tidy up a precondition Move the `if` into the precondition assertion, eliminating one line of code and making the function preconditions clearer to static analysers. Signed-off-by: Philip Withnall --- gobject/gparamspecs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c index 9f281a828..5a54c667d 100644 --- a/gobject/gparamspecs.c +++ b/gobject/gparamspecs.c @@ -2639,8 +2639,7 @@ g_param_spec_value_array (const gchar *name, { GParamSpecValueArray *aspec; - if (element_spec) - g_return_val_if_fail (G_IS_PARAM_SPEC (element_spec), NULL); + g_return_val_if_fail (element_spec == NULL || G_IS_PARAM_SPEC (element_spec), NULL); aspec = g_param_spec_internal (G_TYPE_PARAM_VALUE_ARRAY, name,