From 002c6074a64b31af4f6efd48bfce571fc917606c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 25 Feb 2011 10:40:39 -0500 Subject: [PATCH] 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 --- glib/ghash.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/glib/ghash.c b/glib/ghash.c index 4cf6af4eb..4323068b7 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -283,12 +283,13 @@ g_hash_table_set_shift_from_size (GHashTable *hash_table, gint size) /* * g_hash_table_lookup_node: * @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 * Return value: index of the described #GHashNode * - * Performs a lookup in the hash table. Virtually all hash operations - * will use this function internally. + * Performs a lookup in the hash table. + * + * Virtually all hash operations will use this function internally. * * This function first computes the hash value of the key using the * user's hash function. @@ -917,7 +918,8 @@ g_hash_table_lookup (GHashTable *hash_table, * for example before calling g_hash_table_remove(). * * 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. **/