updated hash methods. just increasing the size of the hash helps a lot with loading larger networks. perhaps hash could be extended to dynamically size based on network size.
This commit is contained in:
20
src/hash.h
20
src/hash.h
@@ -7,22 +7,22 @@
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
#define HTMAXSIZE 1999
|
||||
#define ENHASHTABLEMAXSIZE 128000
|
||||
#define NOTFOUND 0
|
||||
|
||||
struct HTentry
|
||||
typedef struct HTentryStruct
|
||||
{
|
||||
char *key;
|
||||
int data;
|
||||
struct HTentry *next;
|
||||
};
|
||||
struct HTentryStruct *next;
|
||||
} ENHashEntry;
|
||||
|
||||
typedef struct HTentry *HTtable;
|
||||
typedef ENHashEntry *ENHashTable;
|
||||
|
||||
HTtable *HTcreate(void);
|
||||
int HTinsert(HTtable *, char *, int);
|
||||
int HTfind(HTtable *, char *);
|
||||
char *HTfindKey(HTtable *, char *);
|
||||
void HTfree(HTtable *);
|
||||
ENHashTable *ENHashTableCreate(void);
|
||||
int ENHashTableInsert(ENHashTable *, char *, int);
|
||||
int ENHashTableFind(ENHashTable *, char *);
|
||||
char *ENHashTableFindKey(ENHashTable *, char *);
|
||||
void ENHashTableFree(ENHashTable *);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user