paramspec: Move condition check inside the g_return
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 10 Nov 2017 17:07:28 +0000 (12:07 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 10 Nov 2017 17:09:41 +0000 (12:09 -0500)
It's mostly a debug check and crash avoidance, it's better to
keep all the condition inside the macro.

gst/gstparamspecs.c

index a0725fc..a41cc8e 100644 (file)
@@ -352,8 +352,8 @@ gst_param_spec_array (const gchar * name,
 {
   GstParamSpecArray *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 (GST_TYPE_PARAM_ARRAY_LIST,
       name, nick, blurb, flags);