mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
gbinding: Avoid a string copy of interned property names
Interned strings are never freed, so we don’t need to take a copy of them when returning them in a #GValue. This is a minor memory allocation improvement, with no functional changes. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
ae27f50342
commit
26970edc9f
@ -539,7 +539,8 @@ g_binding_get_property (GObject *gobject,
|
||||
break;
|
||||
|
||||
case PROP_SOURCE_PROPERTY:
|
||||
g_value_set_string (value, binding->source_property);
|
||||
/* @source_property is interned, so we don’t need to take a copy */
|
||||
g_value_set_static_string (value, binding->source_property);
|
||||
break;
|
||||
|
||||
case PROP_TARGET:
|
||||
@ -547,7 +548,8 @@ g_binding_get_property (GObject *gobject,
|
||||
break;
|
||||
|
||||
case PROP_TARGET_PROPERTY:
|
||||
g_value_set_string (value, binding->target_property);
|
||||
/* @target_property is interned, so we don’t need to take a copy */
|
||||
g_value_set_static_string (value, binding->target_property);
|
||||
break;
|
||||
|
||||
case PROP_FLAGS:
|
||||
|
Loading…
Reference in New Issue
Block a user