GHashTable: Clarify g_hash_table_lookup_extended docs

Passing NULL as a key is only ok if your hash and equal functions
can deal with it.
https://bugzilla.gnome.org/show_bug.cgi?id=642944
This commit is contained in:
Matthias Clasen 2011-02-25 10:40:39 -05:00
parent 989088308a
commit 002c6074a6

View File

@ -283,12 +283,13 @@ g_hash_table_set_shift_from_size (GHashTable *hash_table, gint size)
/* /*
* g_hash_table_lookup_node: * g_hash_table_lookup_node:
* @hash_table: our #GHashTable * @hash_table: our #GHashTable
* @key: the key to lookup against * @key: the key to lookup against (may be %NULL)
* @hash_return: optional key hash return location * @hash_return: optional key hash return location
* Return value: index of the described #GHashNode * Return value: index of the described #GHashNode
* *
* Performs a lookup in the hash table. Virtually all hash operations * Performs a lookup in the hash table.
* will use this function internally. *
* Virtually all hash operations will use this function internally.
* *
* This function first computes the hash value of the key using the * This function first computes the hash value of the key using the
* user's hash function. * user's hash function.
@ -917,7 +918,8 @@ g_hash_table_lookup (GHashTable *hash_table,
* for example before calling g_hash_table_remove(). * for example before calling g_hash_table_remove().
* *
* You can actually pass %NULL for @lookup_key to test * You can actually pass %NULL for @lookup_key to test
* whether the %NULL key exists. * whether the %NULL key exists, provided the hash and equal functions
* of @hash_table are %NULL-safe.
* *
* Return value: %TRUE if the key was found in the #GHashTable. * Return value: %TRUE if the key was found in the #GHashTable.
**/ **/