From f1f80111c9bb691c658e8657c450845387cbefd1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 7 Sep 2015 02:33:50 -0400 Subject: [PATCH] Simplify g_param_spec_get_redirect_target There is no need to do a type check in a g_return_if_fail if the type check is tne next thing the function does anyway. --- gobject/gparam.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gobject/gparam.c b/gobject/gparam.c index 677f16cb3..bf2028e97 100644 --- a/gobject/gparam.c +++ b/gobject/gparam.c @@ -579,14 +579,8 @@ g_param_spec_steal_qdata (GParamSpec *pspec, GParamSpec* g_param_spec_get_redirect_target (GParamSpec *pspec) { - g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL); - if (G_IS_PARAM_SPEC_OVERRIDE (pspec)) - { - GParamSpecOverride *ospec = G_PARAM_SPEC_OVERRIDE (pspec); - - return ospec->overridden; - } + return ((GParamSpecOverride*)pspec)->overridden; else return NULL; }