From 1d8e0cc69a45d02b808bb168808b6245d420ed18 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Wed, 14 Oct 2020 22:34:35 -0400 Subject: [PATCH] Swap LLError internal LevelMap to absl::flat_hash_map for faster lookup speed --- indra/llcommon/llerror.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 84b3ab8ce5f..dc9cffb94e8 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -451,7 +451,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; @@ -900,10 +900,9 @@ namespace LLError namespace { void setLevels(LevelMap& map, const LLSD& list, LLError::ELevel level) { - LLSD::array_const_iterator i, end; - for (i = list.beginArray(), end = list.endArray(); i != end; ++i) + for (const auto& i : list.array()) { - map[*i] = level; + map[i.asString()] = level; } } } -- GitLab