summaryrefslogtreecommitdiff
path: root/libnm-glib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-11-15 16:03:33 +0100
committerThomas Haller <thaller@redhat.com>2017-11-16 11:49:51 +0100
commitb58481b31ec5785d208a7b11df5b05fc50c158e2 (patch)
tree7842c2662049462e6f89b1090af6e51908ea37d6 /libnm-glib
parent3ee8de20c452955b30c28d4c5080a976d77f507c (diff)
downloadNetworkManager-b58481b31ec5785d208a7b11df5b05fc50c158e2.tar.gz
all: don't use g_direct_equal() for hash table equality function
GHashTable optimizes a NULL equality function to use direct pointer comparison. That saves the overhead of calling g_direct_equal(). This is also documented behavior for g_hash_table_new(). While at it, also don't pass g_direct_hash() but use the default of %NULL. The behavior is the same, but consistently don't use g_direct_hash().
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/nm-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index f14c8e49bc..183cdc933f 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -157,7 +157,7 @@ nm_client_init (NMClient *client)
priv->state = NM_STATE_UNKNOWN;
- priv->permissions = g_hash_table_new (g_direct_hash, g_direct_equal);
+ priv->permissions = g_hash_table_new (NULL, NULL);
}
static void