Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] Re: hashtables
Home

[Freeciv-Dev] Re: hashtables

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jed Davis <jldavis@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: hashtables
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxxx>
Date: Fri, 21 Jul 2000 01:03:40 +0100 (WET DST)

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




[Prev in Thread] Current Thread [Next in Thread]