Re: glib.h suggestion: update_hash functions



On Fri, 11 Feb 2000, Darin Adler wrote:

> I have another suggestion for a hash-related change to <glib.h>.
> 
> I often run into situations where I have to hash more than one string. To
> handle this, I'd like some additional functions that tie in with
> g_str_hash's implementation. These would typically be called in hashing
> functions, rather than being hashing functions themselves:
> 
>     guint g_str_update_hash (guint old_hash, const gchar * s);
>     guint g_int_update_hash (guint old_hash, int i);
>     guint g_mem_update_hash (guint old_hash, gconstpointer p, guint c);
> 
> You can use a bunch of calls to the update_hash functions in a row to make a
> hash for a composite object.
> 
> What do you all think? Should I write these up and submit a patch?

you don't really want to call orther functions from hash functions,
KISS, bite the apple and implement your own specialized hash function
for that case, there were enough examples posted already to work from.

> 
>     -- Darin
> 

---
ciaoTJ



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