Commit 70c6f4cd authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Change some llerror and llevents internal maps and sets to flat_hash variants

parent f4f15b8b
......@@ -429,7 +429,7 @@ namespace
}
typedef std::map<std::string, LLError::ELevel> LevelMap;
typedef absl::flat_hash_map<std::string, LLError::ELevel> LevelMap;
typedef std::vector<LLError::RecorderPtr> Recorders;
typedef std::vector<LLError::CallSite*> CallSiteVector;
......@@ -492,7 +492,7 @@ namespace LLError
LevelMap mClassLevelMap;
LevelMap mFileLevelMap;
LevelMap mTagLevelMap;
std::map<std::string, unsigned int> mUniqueLogMessages;
absl::flat_hash_map<std::string, unsigned int> mUniqueLogMessages;
LLError::FatalFunction mCrashFunction;
LLError::TimeFunction mTimeFunction;
......@@ -856,7 +856,7 @@ namespace {
LLSD::array_const_iterator i, end;
for (i = list.beginArray(), end = list.endArray(); i != end; ++i)
{
map[*i] = level;
map[(*i).asString()] = level;
}
}
}
......@@ -1368,7 +1368,7 @@ namespace LLError
{
std::ostringstream message_stream;
std::map<std::string, unsigned int>::iterator messageIter = s->mUniqueLogMessages.find(message);
const auto messageIter = s->mUniqueLogMessages.find(message);
if (messageIter != s->mUniqueLogMessages.end())
{
messageIter->second++;
......
......@@ -53,6 +53,9 @@
#include "llexception.h"
#include "llhandle.h"
#include "absl/container/node_hash_map.h"
#include "absl/container/node_hash_set.h"
/*==========================================================================*|
// override this to allow binding free functions with more parameters
#ifndef LLEVENTS_LISTENER_ARITY
......@@ -280,16 +283,16 @@ testable:
// LLEventPump subclass statically, as a class member, on the stack or on
// the heap. In such cases, the instantiating party is responsible for its
// lifespan.
typedef std::map<std::string, LLEventPump*> PumpMap;
typedef absl::node_hash_map<std::string, LLEventPump*> PumpMap;
PumpMap mPumpMap;
// Set of all LLEventPumps we instantiated. Membership in this set means
// we claim ownership, and will delete them when this LLEventPumps is
// destroyed.
typedef std::set<LLEventPump*> PumpSet;
typedef absl::node_hash_set<LLEventPump*> PumpSet;
PumpSet mOurPumps;
// LLEventPump names that should be instantiated as LLEventQueue rather
// than as LLEventStream
typedef std::set<std::string> PumpNames;
typedef absl::node_hash_set<std::string> PumpNames;
PumpNames mQueueNames;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment