[glib/gobject-speedups4: 2/3] Consistently use param_spec_follow_override




commit df43536a6807063dcd8212041f4aad02193d5e08
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 1a6a21e193..f19c40180e 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -954,6 +954,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
@@ -975,8 +983,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;
 }
@@ -1432,14 +1440,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]