[gtk+] x11: Remove unused hash table



commit b741d32262c1ea3265d102aaf4b1ed2ae5b0c5c0
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 3 22:47:42 2016 +0100

    x11: Remove unused hash table
    
    We were neatly populating it, but nobody ever looked at it.

 gdk/x11/gdkscreen-x11.c |    1 -
 gdk/x11/gdkscreen-x11.h |    1 -
 gdk/x11/gdkvisual-x11.c |   34 ----------------------------------
 3 files changed, 0 insertions(+), 36 deletions(-)
---
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 8555dd3..59d4a27 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -129,7 +129,6 @@ gdk_x11_screen_finalize (GObject *object)
   for (i = 0; i < x11_screen->nvisuals; i++)
     g_object_unref (x11_screen->visuals[i]);
   g_free (x11_screen->visuals);
-  g_hash_table_destroy (x11_screen->visual_hash);
 
   g_free (x11_screen->window_manager_name);
 
diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
index 67cdd53..ee099b5 100644
--- a/gdk/x11/gdkscreen-x11.h
+++ b/gdk/x11/gdkscreen-x11.h
@@ -83,7 +83,6 @@ struct _GdkX11Screen
   GdkVisualType available_types[6];
   gint16 navailable_depths;
   gint16 navailable_types;
-  GHashTable *visual_hash;
   GdkVisual *rgba_visual;
 
   /* cache for window->translate vfunc */
diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
index d9df8e3..b948613 100644
--- a/gdk/x11/gdkvisual-x11.c
+++ b/gdk/x11/gdkvisual-x11.c
@@ -44,12 +44,6 @@ struct _GdkX11VisualClass
   GdkVisualClass visual_class;
 };
 
-static void     gdk_visual_add            (GdkVisual *visual);
-static guint    gdk_visual_hash           (Visual    *key);
-static gboolean gdk_visual_equal          (Visual    *a,
-                                          Visual    *b);
-
-
 G_DEFINE_TYPE (GdkX11Visual, gdk_x11_visual, GDK_TYPE_VISUAL)
 
 static void
@@ -294,9 +288,6 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
        }
     }
 
-  for (i = 0; i < nvisuals; i++)
-    gdk_visual_add (visuals[i]);
-
   if (x11_screen->navailable_types == 0)
     g_error ("unable to find a usable visual type");
 
@@ -363,31 +354,6 @@ gdk_x11_screen_lookup_visual (GdkScreen *screen,
   return NULL;
 }
 
-static void
-gdk_visual_add (GdkVisual *visual)
-{
-  GdkX11Screen *x11_screen = GDK_X11_SCREEN (visual->screen);
-
-  if (!x11_screen->visual_hash)
-    x11_screen->visual_hash = g_hash_table_new ((GHashFunc) gdk_visual_hash,
-                                                (GEqualFunc) gdk_visual_equal);
-
-  g_hash_table_insert (x11_screen->visual_hash, GDK_X11_VISUAL (visual)->xvisual, visual);
-}
-
-static guint
-gdk_visual_hash (Visual *key)
-{
-  return key->visualid;
-}
-
-static gboolean
-gdk_visual_equal (Visual *a,
-                  Visual *b)
-{
-  return (a->visualid == b->visualid);
-}
-
 /**
  * _gdk_visual_get_x11_colormap:
  * @visual: the visual to get the colormap from


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