cloud-setup,glib-aux: use NULL instead of g_direct_equal() for hash tables

This commit is contained in:
Thomas Haller 2022-08-31 09:42:19 +02:00
parent 4c48864972
commit 6b74f3cc14
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 7 additions and 8 deletions

View file

@ -1284,7 +1284,7 @@ test_utils_hashtable_cmp(void)
for (test_run = 0; test_run < 30; test_run++) {
for (is_num_key = 0; is_num_key < 2; is_num_key++) {
GHashFunc func_key_hash = is_num_key ? nm_direct_hash : nm_str_hash;
GEqualFunc func_key_equal = is_num_key ? g_direct_equal : g_str_equal;
GEqualFunc func_key_equal = is_num_key ? NULL : g_str_equal;
GCompareDataFunc func_key_cmp =
is_num_key ? _hash_func_cmp_direct : (GCompareDataFunc) nm_strcmp_with_data;
GCompareDataFunc func_val_cmp =

View file

@ -337,13 +337,12 @@ _nmc_mangle_connection(NMDevice *device,
* We don't need to configure policy routing in this case. */
NM_SET_OUT(out_skipped_single_addr, TRUE);
} else if (config_data->has_ipv4s && config_data->has_cidr) {
gs_unref_hashtable GHashTable *unique_subnets =
g_hash_table_new(nm_direct_hash, g_direct_equal);
NMIPAddress *addr_entry;
NMIPRoute *route_entry;
NMIPRoutingRule *rule_entry;
in_addr_t gateway;
char sbuf[NM_INET_ADDRSTRLEN];
gs_unref_hashtable GHashTable *unique_subnets = g_hash_table_new(nm_direct_hash, NULL);
NMIPAddress *addr_entry;
NMIPRoute *route_entry;
NMIPRoutingRule *rule_entry;
in_addr_t gateway;
char sbuf[NM_INET_ADDRSTRLEN];
for (i = 0; i < config_data->ipv4s_len; i++) {
addr_entry = nm_ip_address_new_binary(AF_INET,