mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Merge branch 'gobject-speedup9' into 'main'
Avoid g_type_class_peek See merge request GNOME/glib!2723
This commit is contained in:
commit
f8c5d71104
@ -1550,16 +1550,17 @@ object_get_property (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
GValue *value)
|
||||
{
|
||||
GObjectClass *class = g_type_class_peek (pspec->owner_type);
|
||||
GTypeInstance *inst = (GTypeInstance *) object;
|
||||
GObjectClass *class;
|
||||
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
|
||||
GParamSpec *redirect;
|
||||
|
||||
if (class == NULL)
|
||||
{
|
||||
g_warning ("'%s::%s' is not a valid property name; '%s' is not a GObject subtype",
|
||||
g_type_name (pspec->owner_type), pspec->name, g_type_name (pspec->owner_type));
|
||||
return;
|
||||
}
|
||||
if (G_LIKELY (inst->g_class->g_type == pspec->owner_type))
|
||||
class = (GObjectClass *) inst->g_class;
|
||||
else
|
||||
class = g_type_class_peek (pspec->owner_type);
|
||||
|
||||
g_assert (class != NULL);
|
||||
|
||||
redirect = g_param_spec_get_redirect_target (pspec);
|
||||
if (redirect)
|
||||
@ -1576,17 +1577,18 @@ object_set_property (GObject *object,
|
||||
const GValue *value,
|
||||
GObjectNotifyQueue *nqueue)
|
||||
{
|
||||
GObjectClass *class = g_type_class_peek (pspec->owner_type);
|
||||
GTypeInstance *inst = (GTypeInstance *) object;
|
||||
GObjectClass *class;
|
||||
GParamSpecClass *pclass;
|
||||
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
|
||||
GParamSpec *redirect;
|
||||
|
||||
if (G_UNLIKELY (class == NULL))
|
||||
{
|
||||
g_warning ("'%s::%s' is not a valid property name; '%s' is not a GObject subtype",
|
||||
g_type_name (pspec->owner_type), pspec->name, g_type_name (pspec->owner_type));
|
||||
return;
|
||||
}
|
||||
if (G_LIKELY (inst->g_class->g_type == pspec->owner_type))
|
||||
class = (GObjectClass *) inst->g_class;
|
||||
else
|
||||
class = g_type_class_peek (pspec->owner_type);
|
||||
|
||||
g_assert (class != NULL);
|
||||
|
||||
redirect = g_param_spec_get_redirect_target (pspec);
|
||||
if (redirect)
|
||||
|
Loading…
Reference in New Issue
Block a user