54 WWASSERT( (HashTableSize & (HashTableSize-1)) == 0 );
64 if ( HashTable !=
NULL) {
72 for (
int i = 0; i < HashTableSize; i++ ) {
81 int index = Hash( entry->
Get_Key() );
83 entry->NextHash = HashTable[ index ];
84 HashTable[ index ] = entry;
92 const char *key = entry->
Get_Key();
93 int index = Hash( key );
95 if ( HashTable[ index ] !=
NULL ) {
98 if ( HashTable[ index ] == entry ) {
99 HashTable[ index ] = entry->NextHash;
105 while ( node->NextHash !=
NULL ) {
106 if ( node->NextHash == entry ) {
107 node->NextHash = entry->NextHash;
110 node = node->NextHash;
120 int index = Hash( key );
121 for (
HashableClass * node = HashTable[ index ]; node !=
NULL; node = node->NextHash ) {
122 if ( ::stricmp( node->Get_Key(), key ) == 0 ) {
129int HashTableClass::Hash(
const char * key )
141 NextEntry = Table.HashTable[ Index ];
148 CurrentEntry = NextEntry;
149 if ( NextEntry !=
NULL ) {
150 NextEntry = NextEntry->NextHash;
155void HashTableIteratorClass::Advance_Next(
void)
157 while ( NextEntry ==
NULL ) {
159 if ( Index >= Table.HashTableSize ) {
162 NextEntry = Table.HashTable[ Index ];
unsigned long CRC_Stringi(const char *string, unsigned long crc)
void Add(HashableClass *entry)
bool Remove(HashableClass *entry)
HashableClass * Find(const char *key)
virtual const char * Get_Key(void)=0