On 15.02.2011 13:04, Johan Corveleyn wrote:
>> In other news, why do we need our own hash function anyway? Or our own
>> table or tree or whatever? NIH syndrome?
> No idea, really. I'm probably not the guy you're expecting an answer
> from :-), but:
> - apr_hashfunc_default could be very useful here, I think.
> - Concerning the tree (see token.c#tree_insert_token), maybe the
> reason is that some special things are done while inserting nodes into
> the tree? (like first comparing with the hash, and if that matches,
> compare the lines themselves; and letting all matching nodes point to
> the same "token" (line), when they're being inserted).

That's what apr_hash_t does ... more or less. Your token can just be the
address of the string in the hash.

-- Brane

Reply via email to