[glib] Simplify g_param_spec_get_redirect_target
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Simplify g_param_spec_get_redirect_target
- Date: Mon, 7 Sep 2015 06:35:04 +0000 (UTC)
commit f1f80111c9bb691c658e8657c450845387cbefd1
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Sep 7 02:33:50 2015 -0400
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 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/gobject/gparam.c b/gobject/gparam.c
index 677f16c..bf2028e 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]