Commit 8dc8b33d authored by Philip Withnall's avatar Philip Withnall

ghash: Clear out arguments to NULL in g_hash_table_lookup_extended()

If the given key is not found, clear the orig_key and value arguments to
NULL as well as returning FALSE. Then the caller can unconditionally
check them.

This makes the behaviour of g_hash_table_lookup_extended() consistent
with g_hash_table_steal_extended().
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
parent ea17d637
......@@ -1190,7 +1190,14 @@ g_hash_table_lookup_extended (GHashTable *hash_table,
node_index = g_hash_table_lookup_node (hash_table, lookup_key, &node_hash);
if (!HASH_IS_REAL (hash_table->hashes[node_index]))
return FALSE;
{
if (orig_key != NULL)
*orig_key = NULL;
if (value != NULL)
*value = NULL;
return FALSE;
}
if (orig_key)
*orig_key = hash_table->keys[node_index];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment