diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-07-27 06:51:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-07-27 06:51:17 -0400 |
commit | 17871e6881beb401eebb8b05eccb01490cfa85b6 (patch) | |
tree | 7d6cfffb517f6538627be420978974f58c6ac6c7 | |
parent | a80e7db1a8f26dc558085844dcb8003edb6eca74 (diff) | |
download | glib-17871e6881beb401eebb8b05eccb01490cfa85b6.tar.gz |
Add a note to the g_str_hash docs
Point out some shortcomings of the djb hash, as found in
https://bugzilla.gnome.org/show_bug.cgi?id=751610
-rw-r--r-- | glib/ghash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/glib/ghash.c b/glib/ghash.c index 5c95c72d0..7f8e5dab0 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -1860,6 +1860,10 @@ g_str_equal (gconstpointer v1, * It can be passed to g_hash_table_new() as the @hash_func parameter, * when using non-%NULL strings as keys in a #GHashTable. * + * Note that this function may not be a perfect fit for all use cases. + * For example, it produces some hash collisions with strings as short + * as 2. + * * Returns: a hash value corresponding to the key */ guint |