MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / lookup

Method lookup

engine/source/string/stringTable.cc:171–190  ·  view source on GitHub ↗

--------------------------------------

Source from the content-addressed store, hash-verified

169
170//--------------------------------------
171StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
172{
173 if ( val == NULL )
174 return StringTable->EmptyString;
175
176 MutexHandle mutex;
177 mutex.lock(&mMutex, true);
178
179 Node **walk, *temp;
180 U32 key = hashString(val);
181 walk = &buckets[key % numBuckets];
182 while((temp = *walk) != NULL) {
183 if(caseSens && !dStrcmp(temp->val, val))
184 return temp->val;
185 else if(!caseSens && !dStricmp(temp->val, val))
186 return temp->val;
187 walk = &(temp->next);
188 }
189 return NULL;
190}
191
192//--------------------------------------
193StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool caseSens)

Callers 6

processMethod · 0.45
isMethodMethod · 0.45
AudioBufferMethod · 0.45
guiListBoxCtrl.ccFile · 0.45

Calls 3

dStrcmpFunction · 0.50
dStricmpFunction · 0.50
lockMethod · 0.45

Tested by

no test coverage detected