mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 12:25:48 +01:00
Merge branch 'gobject-speedup8' into 'main'
Avoid g_param_spec_get_redirect_target See merge request GNOME/glib!2722
This commit is contained in:
commit
b1e371034d
@ -1327,18 +1327,22 @@ g_object_freeze_notify (GObject *object)
|
|||||||
g_object_unref (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
|
static inline void
|
||||||
g_object_notify_by_spec_internal (GObject *object,
|
g_object_notify_by_spec_internal (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GParamSpec *redirected;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (~pspec->flags & G_PARAM_READABLE))
|
if (G_UNLIKELY (~pspec->flags & G_PARAM_READABLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
redirected = g_param_spec_get_redirect_target (pspec);
|
param_spec_follow_override (&pspec);
|
||||||
if (redirected != NULL)
|
|
||||||
pspec = redirected;
|
|
||||||
|
|
||||||
if (pspec != NULL)
|
if (pspec != NULL)
|
||||||
{
|
{
|
||||||
@ -1567,7 +1571,6 @@ object_get_property (GObject *object,
|
|||||||
GTypeInstance *inst = (GTypeInstance *) object;
|
GTypeInstance *inst = (GTypeInstance *) object;
|
||||||
GObjectClass *class;
|
GObjectClass *class;
|
||||||
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
|
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
|
||||||
GParamSpec *redirect;
|
|
||||||
|
|
||||||
if (G_LIKELY (inst->g_class->g_type == pspec->owner_type))
|
if (G_LIKELY (inst->g_class->g_type == pspec->owner_type))
|
||||||
class = (GObjectClass *) inst->g_class;
|
class = (GObjectClass *) inst->g_class;
|
||||||
@ -1576,9 +1579,7 @@ object_get_property (GObject *object,
|
|||||||
|
|
||||||
g_assert (class != NULL);
|
g_assert (class != NULL);
|
||||||
|
|
||||||
redirect = g_param_spec_get_redirect_target (pspec);
|
param_spec_follow_override (&pspec);
|
||||||
if (redirect)
|
|
||||||
pspec = redirect;
|
|
||||||
|
|
||||||
consider_issuing_property_deprecation_warning (pspec);
|
consider_issuing_property_deprecation_warning (pspec);
|
||||||
|
|
||||||
@ -1595,7 +1596,6 @@ object_set_property (GObject *object,
|
|||||||
GObjectClass *class;
|
GObjectClass *class;
|
||||||
GParamSpecClass *pclass;
|
GParamSpecClass *pclass;
|
||||||
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
|
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
|
||||||
GParamSpec *redirect;
|
|
||||||
|
|
||||||
if (G_LIKELY (inst->g_class->g_type == pspec->owner_type))
|
if (G_LIKELY (inst->g_class->g_type == pspec->owner_type))
|
||||||
class = (GObjectClass *) inst->g_class;
|
class = (GObjectClass *) inst->g_class;
|
||||||
@ -1604,9 +1604,7 @@ object_set_property (GObject *object,
|
|||||||
|
|
||||||
g_assert (class != NULL);
|
g_assert (class != NULL);
|
||||||
|
|
||||||
redirect = g_param_spec_get_redirect_target (pspec);
|
param_spec_follow_override (&pspec);
|
||||||
if (redirect)
|
|
||||||
pspec = redirect;
|
|
||||||
|
|
||||||
consider_issuing_property_deprecation_warning (pspec);
|
consider_issuing_property_deprecation_warning (pspec);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user