diff options
author | Graham Madarasz (Graham) <graham@lindenlab.com> | 2013-02-28 15:35:14 -0800 |
---|---|---|
committer | Graham Madarasz (Graham) <graham@lindenlab.com> | 2013-02-28 15:35:14 -0800 |
commit | 93eaccae6fe6e8442a3c6e5a2d40a408aa44df77 (patch) | |
tree | 7e115b8278532bb100b07b8ed56d213b383d4c96 /indra/llcommon/llinstancetracker.cpp | |
parent | 2dcbbf04c9375e2de877956476e0a58219a169cf (diff) |
Modify LLInstanceTracker to avoid using a map of strings to find a map of foo to find some pointers
Diffstat (limited to 'indra/llcommon/llinstancetracker.cpp')
-rw-r--r-- | indra/llcommon/llinstancetracker.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 5dc3ea5d7b..0804be358f 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,18 +32,14 @@ // external library headers // other Linden headers -//static -void * & LLInstanceTrackerBase::getInstances(std::type_info const & info) -{ - typedef std::map<std::string, void *> InstancesMap; - static InstancesMap instances; +static void* sInstanceTrackerData[ kInstanceTrackTypeCount ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) +{ // std::map::insert() is just what we want here. You attempt to insert a // (key, value) pair. If the specified key doesn't yet exist, it inserts // the pair and returns a std::pair of (iterator, true). If the specified // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. - return instances.insert(InstancesMap::value_type(info.name(), - InstancesMap::mapped_type())) - .first->second; -} + return sInstanceTrackerData[t]; +}
\ No newline at end of file |