Use hash tables as sets in various places

Where we were already treating GHashTables as sets, modify them to use
the set-specific APIs g_hash_table_add() and g_hash_table_contains(), to
make that usage more obvious and less prone to being broken.

Heavily based on patches by Garrett Regier <garrettregier@gmail.com>.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=749371
This commit is contained in:
Philip Withnall
2017-10-25 10:53:14 +01:00
parent e130d2e511
commit 3eacec1587
9 changed files with 25 additions and 22 deletions

View File

@@ -948,7 +948,7 @@ g_param_spec_pool_insert (GParamSpecPool *pool,
g_mutex_lock (&pool->mutex);
pspec->owner_type = owner_type;
g_param_spec_ref (pspec);
g_hash_table_insert (pool->hash_table, pspec, pspec);
g_hash_table_add (pool->hash_table, pspec);
g_mutex_unlock (&pool->mutex);
}
else