Alle Hashfunktionen mit Primzahlen, evtl. bessere Performance.

This commit is contained in:
Enno Rehling 2004-05-26 06:42:58 +00:00
parent 6298a3a165
commit 5296949c1b
15 changed files with 16 additions and 16 deletions

View File

@ -104,7 +104,7 @@ typedef struct translation {
const char * value;
} translation;
#define TRANSMAXHASH 255
#define TRANSMAXHASH 257
static translation * translation_table[TRANSMAXHASH];
static translation * junkyard;
@ -421,7 +421,7 @@ creport_cleanup(void)
/*static int msgno; */
#define MTMAXHASH 1023
#define MTMAXHASH 1021
static struct known_mtype {
const struct message_type * mtype;

View File

@ -2594,7 +2594,7 @@ prepare_report(faction * f)
#endif
}
#define FMAXHASH 1023
#define FMAXHASH 1021
struct fsee {
struct fsee * nexthash;

View File

@ -137,7 +137,7 @@ buildingmaintenance(const building * b, const resource_type * rtype)
return cost;
}
#define BMAXHASH 8191
#define BMAXHASH 7919
static building *buildhash[BMAXHASH];
void
bhash(building * b)

View File

@ -58,7 +58,7 @@
/* ------------------------------------------------------------- */
#define MAXENTITYHASH 8191
#define MAXENTITYHASH 7919
curse *cursehash[MAXENTITYHASH];
void

View File

@ -562,7 +562,7 @@ ufindhash (int i)
return u;
}
#define FMAXHASH 2047
#define FMAXHASH 2039
faction * factionhash[FMAXHASH];
void

View File

@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
#define GMAXHASH 2047
#define GMAXHASH 2039
static group * ghash[GMAXHASH];
static int maxgid;

View File

@ -19,7 +19,7 @@
#include <stdlib.h>
#include <limits.h>
#define PMAXHASH 1023
#define PMAXHASH 1021
typedef struct player_hash {
struct player * entries;

View File

@ -257,7 +257,7 @@ attrib_type at_moveblock = {
};
#define RMAXHASH 65535
#define RMAXHASH 65521
region *regionhash[RMAXHASH];
static region *

View File

@ -907,7 +907,7 @@ get_addresses(faction * f)
}
seen_region * reuse;
#define MAXSEEHASH 4095
#define MAXSEEHASH 4999
seen_region * seehash[MAXSEEHASH];
void

View File

@ -158,7 +158,7 @@ typedef struct uniquenode {
faction * f;
} uniquenode;
#define HASHSIZE 2047
#define HASHSIZE 2039
static uniquenode * uniquehash[HASHSIZE];
static faction *

View File

@ -84,7 +84,7 @@ st_register(const ship_type * type) {
shiptypes = stl;
}
#define SMAXHASH 8191
#define SMAXHASH 7919
ship *shiphash[SMAXHASH];
void
shash(ship * s)

View File

@ -74,7 +74,7 @@ u_unknown(void)
return &unknown;
}
#define DMAXHASH 8191
#define DMAXHASH 7919
typedef struct dead {
struct dead * nexthash;
faction * f;

View File

@ -21,7 +21,7 @@
#include <string.h>
#include <stdlib.h>
#define MAXATHASH 63
#define MAXATHASH 61
attrib_type * at_hash[MAXATHASH];
static unsigned int

View File

@ -126,7 +126,7 @@ typedef struct messagetype_list {
const struct message_type * data;
} messagetype_list;
#define MT_MAXHASH 1023
#define MT_MAXHASH 1021
static messagetype_list * messagetypes[MT_MAXHASH];
const message_type *

View File

@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h>
#define NRT_MAXHASH 1023
#define NRT_MAXHASH 1021
static nrmessage_type * messagetypes[NRT_MAXHASH];
const char *