summaryrefslogtreecommitdiff
path: root/indra/llui/lluicolortable.cpp
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2026-01-10 01:24:56 -0500
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-01-21 22:07:08 +0200
commit0e687a83b5bd3fd0b33f7e9a5f5955391ec2d5e5 (patch)
tree7d4846f8e201a8432fb6eb571c230bee58d39c22 /indra/llui/lluicolortable.cpp
parent76a80b6787290dc8a950b43b67e5b4cd6238014f (diff)
Optimize various usages of std::map with frequent find access with std::unordered_map
Introduce ll::string_hash heterogeneous string hasher
Diffstat (limited to 'indra/llui/lluicolortable.cpp')
-rw-r--r--indra/llui/lluicolortable.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index a792cb8103..7a4f72fe4f 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -198,8 +198,8 @@ LLUIColor LLUIColorTable::getColor(std::string_view name, const LLColor4& defaul
// update user color, loaded colors are parsed on initialization
void LLUIColorTable::setColor(std::string_view name, const LLColor4& color)
{
- auto it = mUserSetColors.lower_bound(name);
- if(it != mUserSetColors.end() && !(mUserSetColors.key_comp()(name, it->first)))
+ auto it = mUserSetColors.find(name);
+ if(it != mUserSetColors.end())
{
it->second = color;
}
@@ -330,9 +330,8 @@ void LLUIColorTable::clearTable(string_color_map_t& table)
// if the color already exists it changes the color
void LLUIColorTable::setColor(std::string_view name, const LLColor4& color, string_color_map_t& table)
{
- string_color_map_t::iterator it = table.lower_bound(name);
- if(it != table.end()
- && !(table.key_comp()(name, it->first)))
+ string_color_map_t::iterator it = table.find(name);
+ if(it != table.end())
{
it->second = color;
}