mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Check for key on p_hash_table_add
This commit is contained in:
parent
b1da6d1bc4
commit
ce8f574444
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user