[gjs] maint: Use NULL instead of g_direct_equal()



commit b1118b3e4189bd0b17c6369999a64e0de775165c
Author: Philip Chimento <philip endlessm com>
Date:   Wed Nov 9 12:55:54 2016 -0800

    maint: Use NULL instead of g_direct_equal()
    
    According to the documentation, passing NULL as the hash table equal
    function has the same effect as g_direct_equal() only without the
    overhead of a function call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773763

 gi/arg.cpp         |    2 +-
 gi/fundamental.cpp |    5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 1ad0dd9..99a9585 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -338,7 +338,7 @@ create_hash_table_for_key_type(GITypeInfo  *key_param_info)
 
     if (key_type == GI_TYPE_TAG_UTF8 || key_type == GI_TYPE_TAG_FILENAME)
         return g_hash_table_new(g_str_hash, g_str_equal);
-    return g_hash_table_new(g_direct_hash, g_direct_equal);
+    return g_hash_table_new(NULL, NULL);
 }
 
 /* Converts a JS::Value to a GHashTable key, stuffing it into @pointer_out if
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index d2a4cce..86876f3 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -90,10 +90,7 @@ _ensure_mapping_table(GjsContext *context)
                                            gjs_fundamental_table_quark());
 
     if (G_UNLIKELY(table == NULL)) {
-        table = g_hash_table_new_full(g_direct_hash,
-                                      g_direct_equal,
-                                      NULL,
-                                      NULL);
+        table = g_hash_table_new(NULL, NULL);
         g_object_set_qdata_full((GObject *) context,
                                 gjs_fundamental_table_quark(),
                                 table,


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