[glib/gobject-speedups4: 11/11] Consistently use param_spec_follow_override




commit 69c34c2ae2eb6cc2d7125f41c8d7ce4b30cdb0fc
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 7 08:52:00 2022 -0400

    Consistently use param_spec_follow_override

 gobject/gobject.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 204700ca31..4c1d7e5ffb 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -949,6 +949,14 @@ g_object_interface_install_property (gpointer      g_iface,
   (void) install_property_internal (iface_class->g_type, 0, pspec);
 }
 
+/* Inlined version of g_param_spec_get_redirect_target(), for speed */
+static inline void
+param_spec_follow_override (GParamSpec **pspec)
+{
+  if (((GTypeInstance *) (*pspec))->g_class->g_type == G_TYPE_PARAM_OVERRIDE)
+    *pspec = ((GParamSpecOverride *) (*pspec))->overridden;
+}
+
 /**
  * g_object_class_find_property:
  * @oclass: a #GObjectClass
@@ -970,8 +978,8 @@ g_object_class_find_property (GObjectClass *class,
 
   pspec = find_pspec (class, property_name);
 
-  if (pspec && ((GTypeInstance *)pspec)->g_class->g_type == G_TYPE_PARAM_OVERRIDE)
-    pspec = ((GParamSpecOverride *)pspec)->overridden;
+  if (pspec)
+    param_spec_follow_override (&pspec);
 
   return pspec;
 }
@@ -1427,14 +1435,6 @@ g_object_freeze_notify (GObject *object)
   g_object_unref (object);
 }
 
-/* Inlined version of g_param_spec_get_redirect_target(), for speed */
-static inline void
-param_spec_follow_override (GParamSpec **pspec)
-{
-  if (((GTypeInstance *) (*pspec))->g_class->g_type == G_TYPE_PARAM_OVERRIDE)
-    *pspec = ((GParamSpecOverride *) (*pspec))->overridden;
-}
-
 static inline void
 g_object_notify_by_spec_internal (GObject    *object,
                                   GParamSpec *pspec)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]