Re: Bug in GHash




Jeff Garzik <jgarzik@pobox.com> writes:

> One major and one minor bug in ghash:
> 
> * g_hash_table_insert _overwrites_ whatever is in the current bucket
> with the new value.  (it should instead append to a list)

I don't think so.

On failure g_hash_table_lookup_node() returns a pointer tail
of the list for the bucket. (By common sense, hash tables
are not badly broken. They are used all over the place
in GTK+ and the GIMP)
 
> * Some of the other g_hash_table_* functions support multiple values for
> a single key, but g_hash_table_insert comment states (implicitly) that
> if a key/value pair is inserted and the key already exists, the new
> value overwrites the old value on the same key.

How does it make any sense to have multiple values for
a single key? A hash table is a 1-1 lookup function ...

Regards,
                                        Owen



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