mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Add profiling to StringTable.
This commit is contained in:
parent
e9308e40ed
commit
40b871e652
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "core/strings/stringFunctions.h"
|
||||
#include "core/stringTable.h"
|
||||
#include "platform/profiler.h"
|
||||
|
||||
_StringTable *_gStringTable = NULL;
|
||||
const U32 _StringTable::csm_stInitSize = 29;
|
||||
|
|
@ -121,6 +122,8 @@ void _StringTable::destroy()
|
|||
//--------------------------------------
|
||||
StringTableEntry _StringTable::insert(const char* _val, const bool caseSens)
|
||||
{
|
||||
PROFILE_SCOPE(StringTableInsert);
|
||||
|
||||
// Added 3/29/2007 -- If this is undesirable behavior, let me know -patw
|
||||
const char *val = _val;
|
||||
if( val == NULL )
|
||||
|
|
@ -165,6 +168,8 @@ StringTableEntry _StringTable::insertn(const char* src, S32 len, const bool cas
|
|||
//--------------------------------------
|
||||
StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
|
||||
{
|
||||
PROFILE_SCOPE(StringTableLookup);
|
||||
|
||||
Node **walk, *temp;
|
||||
U32 key = hashString(val);
|
||||
walk = &buckets[key % numBuckets];
|
||||
|
|
@ -181,6 +186,8 @@ StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
|
|||
//--------------------------------------
|
||||
StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool caseSens)
|
||||
{
|
||||
PROFILE_SCOPE(StringTableLookupN);
|
||||
|
||||
Node **walk, *temp;
|
||||
U32 key = hashStringn(val, len);
|
||||
walk = &buckets[key % numBuckets];
|
||||
|
|
|
|||
Loading…
Reference in a new issue