[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: modules for generic unordered sets and mappings
From: |
Jim Meyering |
Subject: |
Re: RFC: modules for generic unordered sets and mappings |
Date: |
Fri, 02 Jul 2010 10:08:38 +0200 |
Paul Eggert wrote:
...
>> Here the search method returns a void *, with value (void*)-1
>> denoting "not found". Hmm, or should the search method better take a
>> 'bool *' argument???
>
> Whatever it is, it should be simple and fast.
>
> Also, there needs to be a fast and easy way to say "I want to add this
> to the table, but only if it's not there already, and if it is there
> already I want you to tell me what value is already there, and I want
> to be able to tell that I didn't add anything to the table".
Exactly.
This is why I changed the hash module yesterday.
Without the new interface, it was not possible
to do what I wanted (attempt insert and know what happened)
without a preceding hash_lookup query.
Now, with no extra cost, hash_insert0 is the only
function I need to call.