mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
g_object_new(): skip varargs for simple calls
g_object_new() avoids useless varargs processing for simple calls with no properties. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=605883
This commit is contained in:
parent
8c293b0ae0
commit
f4ccd96ea1
@ -1087,6 +1087,10 @@ g_object_new (GType object_type,
|
||||
|
||||
g_return_val_if_fail (G_TYPE_IS_OBJECT (object_type), NULL);
|
||||
|
||||
/* short circuit for calls supplying no properties */
|
||||
if (!first_property_name)
|
||||
return g_object_newv (object_type, 0, NULL);
|
||||
|
||||
va_start (var_args, first_property_name);
|
||||
object = g_object_new_valist (object_type, first_property_name, var_args);
|
||||
va_end (var_args);
|
||||
|
Loading…
Reference in New Issue
Block a user