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:
Christian Hergert 2024-09-06 09:58:53 -07:00
parent afa562c832
commit da5b62ab3d

View File

@ -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);
}
/**