Bug in GHash



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)

* 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.

	Jeff





On Sat, 23 Jan 1999, Jeff Garzik wrote:

> The following test (attached) inserts 20 values into a hash table.  The
> key is a number (0-19) stored as a string, hashed w/ a custom CRC hash
> function.  The value is a g_strdup'd copy of that same number, stored as
> a string formatted from "%d value".
> 
> The current ghash code seems to be failing miserably on this easy test.
[...]



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