[Freeciv-Dev] Re: hashtables
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 19 Jul 2000, Jed Davis wrote:
> Would there be any problem with requiring hashtable (common/hash.*) sizes
> to be powers of two? The current situation seems to be more of a
Yes there would.
Powers of two aren't prime numbers (by definition, except 1 & 2).
Having hashtable sizes based on prime numbers reduces the number of key
collisions.
> suggestion than a requirement, and some hash functions (including the one
> I'd wanted to replace hash_fval_int with) need this constraint.
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
|
|