Re: Fwd: Re: [Libclc-developers] Introducing the double linked list interface
Status: Planning
Brought to you by:
augestad
|
From: Thomas S. <ts...@ci...> - 2003-03-19 21:30:42
|
Michael B.Allen wrote: > > It's not entirely obvious to me why the comparator is really necessay. If > the user supplies a hash function you can just compare hashes yes? Yes, > there could be a collision but with a suitible hash function the chances > of that are roughly 1 in ULONG_MAX which on my machine appears to be 1 > in 4,294,967,295. That is a small chance. But can you make a hash function which produces hashes over the whole range? I don't think you can. And if a collision does happen it is going to be a rather subtle bug I would imagine. And if the table has less than in 4,294,967,295 buckets then the chance of collision increases. And equality can mean different things to different people. Same value, same object, matching only part of a string. In short, I think a compare function will improve the map/hashtable and make it useful in more situations. -- Thomas. |