plugin/default: Init quark before using

Cut lines in pieces, and remove useless "optimizations" while at it

https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
This commit is contained in:
Jonas Ådahl 2019-11-01 13:15:57 +01:00
parent 1f5b403524
commit 955b27637c

View File

@ -750,12 +750,17 @@ free_display_tile_preview (gpointer data)
static DisplayTilePreview * static DisplayTilePreview *
get_display_tile_preview (MetaDisplay *display) get_display_tile_preview (MetaDisplay *display)
{ {
DisplayTilePreview *preview = g_object_get_qdata (G_OBJECT (display), display_tile_preview_data_quark); DisplayTilePreview *preview;
if (G_UNLIKELY (display_tile_preview_data_quark == 0)) if (!display_tile_preview_data_quark)
display_tile_preview_data_quark = g_quark_from_static_string (DISPLAY_TILE_PREVIEW_DATA_KEY); {
display_tile_preview_data_quark =
g_quark_from_static_string (DISPLAY_TILE_PREVIEW_DATA_KEY);
}
if (G_UNLIKELY (!preview)) preview = g_object_get_qdata (G_OBJECT (display),
display_tile_preview_data_quark);
if (!preview)
{ {
preview = g_slice_new0 (DisplayTilePreview); preview = g_slice_new0 (DisplayTilePreview);