gparam: Remove unnecessary conditionals around preconditions
authorColin Walters <walters@verbum.org>
Thu, 12 Jun 2014 17:37:16 +0000 (13:37 -0400)
committerColin Walters <walters@verbum.org>
Thu, 12 Jun 2014 17:38:27 +0000 (13:38 -0400)
These cause a static analyzer to think we're trying to actually handle
them being NULL, which is not the case.  They both must not be NULL,
period.

No idea why the code was like this originally.

Reviewed by mclasen on IRC.

gobject/gparam.c

index 80a553b..c69ee02 100644 (file)
@@ -1062,11 +1062,8 @@ g_param_spec_pool_lookup (GParamSpecPool *pool,
   GParamSpec *pspec;
   gchar *delim;
 
-  if (!pool || !param_name)
-    {
-      g_return_val_if_fail (pool != NULL, NULL);
-      g_return_val_if_fail (param_name != NULL, NULL);
-    }
+  g_return_val_if_fail (pool != NULL, NULL);
+  g_return_val_if_fail (param_name != NULL, NULL);
 
   g_mutex_lock (&pool->mutex);