[glib] GHashTable: Clarify g_hash_table_lookup_extended docs



commit d2d756439f1c6e434a3a8b348c17d63b6a452e9e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 25 10:40:39 2011 -0500

    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 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/glib/ghash.c b/glib/ghash.c
index 4cf6af4..4323068 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.
  **/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]