[glib/gobject-speedups: 21/23] Avoid g_param_spec_get_redirect_target
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gobject-speedups: 21/23] Avoid g_param_spec_get_redirect_target
- Date: Tue, 31 May 2022 20:15:10 +0000 (UTC)
commit a7ea6a5f0bcaedda86e858de69fb3f4779337539
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 19 21:00:37 2022 -0400
Avoid g_param_spec_get_redirect_target
Inline the getting of the redirect target.
This is a rare thing, and the calls were
showing up in profiles.
gobject/gobject.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index c0d77c5542..b2fba836e0 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1335,9 +1335,8 @@ g_object_notify_by_spec_internal (GObject *object,
if (G_UNLIKELY (~pspec->flags & G_PARAM_READABLE))
return;
- redirected = g_param_spec_get_redirect_target (pspec);
- if (redirected != NULL)
- pspec = redirected;
+ if (((GTypeInstance *)pspec)->g_class->g_type == G_TYPE_PARAM_OVERRIDE)
+ pspec = ((GParamSpecOverride *)pspec)->overridden;
if (pspec != NULL &&
_g_object_has_notify_handler (object))
@@ -1566,7 +1565,6 @@ object_get_property (GObject *object,
{
GObjectClass *class = g_type_class_peek (pspec->owner_type);
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
- GParamSpec *redirect;
if (class == NULL)
{
@@ -1575,9 +1573,8 @@ object_get_property (GObject *object,
return;
}
- redirect = g_param_spec_get_redirect_target (pspec);
- if (redirect)
- pspec = redirect;
+ if (((GTypeInstance *)pspec)->g_class->g_type == G_TYPE_PARAM_OVERRIDE)
+ pspec = ((GParamSpecOverride *)pspec)->overridden;
consider_issuing_property_deprecation_warning (pspec);
@@ -1593,7 +1590,6 @@ object_set_property (GObject *object,
GObjectClass *class = g_type_class_peek (pspec->owner_type);
GParamSpecClass *pclass;
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
- GParamSpec *redirect;
if (G_UNLIKELY (class == NULL))
{
@@ -1602,9 +1598,8 @@ object_set_property (GObject *object,
return;
}
- redirect = g_param_spec_get_redirect_target (pspec);
- if (redirect)
- pspec = redirect;
+ if (((GTypeInstance *)pspec)->g_class->g_type == G_TYPE_PARAM_OVERRIDE)
+ pspec = ((GParamSpecOverride *)pspec)->overridden;
consider_issuing_property_deprecation_warning (pspec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]