gtkcssprovider: Use g_file_peek_path to get the uri for the sysprof marker

This avoids an extra allocation.

Additionally avoid calling it if file is already null.
This commit is contained in:
Jordan Petridis
2024-10-07 18:55:44 +02:00
parent e6cafa890d
commit 83387608ee

View File

@@ -1267,9 +1267,9 @@ gtk_css_provider_load_internal (GtkCssProvider *self,
if (GDK_PROFILER_IS_RUNNING)
{
char *uri = g_file_get_uri (file);
const char *uri G_GNUC_UNUSED;
uri = file ? g_file_peek_path (file) : NULL;
gdk_profiler_end_mark (before, "CSS theme load", uri);
g_free (uri);
}
}