From 23e37e05d2134270243852e519e9c715e37aa496 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 20 Sep 2021 08:18:32 -0400 Subject: [PATCH] Small optimization for g_object_set We've already followed the redirection, no need to check for that again - just avoid notifying non-readable properties. --- gobject/gobject.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/gobject/gobject.c b/gobject/gobject.c index 9776d7c95..3767058c4 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -1570,15 +1570,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); }