summaryrefslogtreecommitdiff
path: root/gobject/gparamspecs.c
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2022-05-25 14:41:25 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2022-05-25 14:44:48 +0100
commitf157c7d0d37c44205f17acead2dbbecc5e996dae (patch)
tree11d3fd2cccc4a764ab009526fd8c8c3d0b413cca /gobject/gparamspecs.c
parent96f4c2b095b9a7043c8910f437943555928ea5b3 (diff)
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 <pwithnall@endlessos.org>
Diffstat (limited to 'gobject/gparamspecs.c')
-rw-r--r--gobject/gparamspecs.c3
1 files changed, 1 insertions, 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,