--- trunk/OOPSE-4/src/io/Globals.cpp 2005/03/10 19:11:44 2108 +++ trunk/OOPSE-4/src/io/Globals.cpp 2005/03/10 20:28:17 2109 @@ -123,12 +123,6 @@ Globals::~Globals(){ Globals::~Globals(){ int i; - - for( i=0; imatch( lhs ); + + CommandMapType::iterator iter; + std::string keyword(lhs); + iter = command_table.find(keyword); + if (iter != command_table.end()) { + token = iter->second; + } if( token ){ @@ -1935,48 +1927,5 @@ int Globals::globalEnd( event* the_event ){ if( the_event->err_msg != NULL ) return 0; return 1; -} - -int Globals::hash( char* text ){ - - register unsigned short int i = 0; // loop counter - int key = 0; // the hash key - - while( text[i] != '\0' ){ - - key = ( ( key << hash_shift ) + text[i] ) % hash_size; - - i++; - } - - if( key < 0 ){ - - // if the key is less than zero, we've had an overflow error - - sprintf( painCave.errMsg, - "There has been an overflow error in the Globals' hash key."); - painCave.isFatal = 1; - simError(); -#ifdef IS_MPI - if( painCave.isEventLoop ){ - if( worldRank == 0 ) mpiInterfaceExit(); - } -#endif //is_mpi - } - - return key; } -void Globals::addHash( char* text, int token ){ - - int key; - LinkedCommand* the_element; - - the_element = new LinkedCommand; - the_element->setValues( text, token ); - - key = hash( text ); - - the_element->setNext( command_table[key] ); - command_table[key] = the_element; -}