[mutter/gnome-3-34] plugin/default: Init quark before using



commit d7bdaeeb8235d150d45a385f6ddeca62e66b2ac8
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Nov 1 13:15:57 2019 +0100

    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

 src/compositor/plugins/default.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c
index e7203ee11..42d28ec20 100644
--- a/src/compositor/plugins/default.c
+++ b/src/compositor/plugins/default.c
@@ -750,12 +750,17 @@ free_display_tile_preview (gpointer data)
 static DisplayTilePreview *
 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))
-    display_tile_preview_data_quark = g_quark_from_static_string (DISPLAY_TILE_PREVIEW_DATA_KEY);
+  if (!display_tile_preview_data_quark)
+    {
+      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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]