diff options
author | matthijs <matthijs@openttd.org> | 2005-04-07 19:19:16 +0000 |
---|---|---|
committer | matthijs <matthijs@openttd.org> | 2005-04-07 19:19:16 +0000 |
commit | da3621c1804e6da9cefd712da9d0dd48fff61add (patch) | |
tree | 034da873c7ef2d41762a674839ff36339133a41e /queue.h | |
parent | 9c3813e21374c71da7c1c49cf52d68546815c1b0 (diff) | |
download | openttd-da3621c1804e6da9cefd712da9d0dd48fff61add.tar.xz |
(svn r2165) - Codechange: [NPF] Properly enummed NPF hash size, it is easily changable now.
- Codechange: [NPF] Improved the NPF hash calculation slightly.
- Codechange: [NPF] Increased hash size, should speed up somewhat.
Diffstat (limited to 'queue.h')
-rw-r--r-- | queue.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4,6 +4,7 @@ //#define NOFREE //#define QUEUE_DEBUG //#define HASH_DEBUG +//#define HASH_STATS typedef struct Queue Queue; @@ -142,7 +143,8 @@ struct HashNode { void* value; HashNode* next; }; -/* Generates a hash code from the given key pair. You should make sure that +/** + * Generates a hash code from the given key pair. You should make sure that * the resulting range is clearly defined. */ typedef uint Hash_HashProc(uint key1, uint key2); @@ -184,7 +186,7 @@ void* Hash_Get(Hash* h, uint key1, uint key2); Hash* new_Hash(Hash_HashProc* hash, int num_buckets); /* Builds a new hash in an existing struct. Make sure that hash() always * returns a hash less than num_buckets! Call delete_hash after use */ -void init_Hash(Hash* h, Hash_HashProc* hash, int num_buckets); +void init_Hash(Hash* h, Hash_HashProc* hash, uint num_buckets); /* * Deletes the hash and cleans up. Only cleans up memory allocated by new_Hash * & friends. If free is true, it will call free() on all the values that |