mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-22 10:12:10 +01:00
gio/gdbusmessage: Avoid most calls to _get_type()
This uses the type_id registered in the previous commit to avoid many calls to g_dbus_message_get_type() for type checking within the source file. We can rely on the type being registered once an object is created and if not, there is no way the type check could succeed anyway.
This commit is contained in:
parent
afa562c832
commit
da5b62ab3d
@ -512,6 +512,9 @@ enum
|
||||
|
||||
G_DEFINE_TYPE (GDBusMessage, g_dbus_message, G_TYPE_OBJECT)
|
||||
|
||||
#undef G_TYPE_DBUS_MESSAGE
|
||||
#define G_TYPE_DBUS_MESSAGE GDBusMessage_type_id
|
||||
|
||||
static void
|
||||
g_dbus_message_finalize (GObject *object)
|
||||
{
|
||||
@ -610,7 +613,7 @@ g_dbus_message_init (GDBusMessage *message)
|
||||
GDBusMessage *
|
||||
g_dbus_message_new (void)
|
||||
{
|
||||
return g_object_new (G_TYPE_DBUS_MESSAGE, NULL);
|
||||
return g_object_new (g_dbus_message_get_type (), NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user