1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Check for key on p_hash_table_add

This commit is contained in:
James Booth 2014-05-22 19:47:50 +01:00
parent b1da6d1bc4
commit ce8f574444

View File

@ -81,7 +81,10 @@ p_list_free_full(GList *items, GDestroyNotify free_func)
gboolean
p_hash_table_add(GHashTable *hash_table, gpointer key)
{
return g_hash_table_replace(hash_table, key, key);
gpointer found = g_hash_table_lookup(hash_table, key);
g_hash_table_replace(hash_table, key, key);
return (found == NULL);
}
gboolean