Merge branch 'prop-set-speedups' into 'main'

Small optimization for g_object_set

See merge request GNOME/glib!2254
This commit is contained in:
Philip Withnall 2021-09-20 12:47:00 +00:00
commit 3f1a1cdb78

View File

@ -1572,15 +1572,9 @@ object_set_property (GObject *object,
{
class->set_property (object, param_id, &tmp_value, pspec);
if (~pspec->flags & G_PARAM_EXPLICIT_NOTIFY)
{
GParamSpec *notify_pspec;
notify_pspec = get_notify_pspec (pspec);
if (notify_pspec != NULL)
g_object_notify_queue_add (object, nqueue, notify_pspec);
}
if (~pspec->flags & G_PARAM_EXPLICIT_NOTIFY &&
pspec->flags & G_PARAM_READABLE)
g_object_notify_queue_add (object, nqueue, pspec);
}
g_value_unset (&tmp_value);
}
@ -2531,17 +2525,14 @@ g_object_getv (GObject *object,
g_object_ref (object);
memset (values, 0, n_properties * sizeof (GValue));
obj_type = G_OBJECT_TYPE (object);
for (i = 0; i < n_properties; i++)
{
pspec = g_param_spec_pool_lookup (pspec_pool,
names[i],
obj_type,
TRUE);
pspec = g_param_spec_pool_lookup (pspec_pool, names[i], obj_type, TRUE);
if (!g_object_get_is_valid_property (object, pspec, names[i]))
break;
memset (&values[i], 0, sizeof (GValue));
g_value_init (&values[i], pspec->value_type);
object_get_property (object, pspec, &values[i]);
}