mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Small optimization for g_object_setv
No need to call memset in the loop, we can just initialize all the values in one go. GtkBuilder is now using g_object_setv, so this may improve application start times a bit.
This commit is contained in:
parent
23e37e05d2
commit
497986cdc1
@ -2523,17 +2523,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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user