summaryrefslogtreecommitdiff
path: root/indra/llui/llurlentry.cpp
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2024-09-17 19:16:25 +0200
committerKitty Barnett <develop@catznip.com>2024-09-17 19:16:25 +0200
commit25f8cbece402c0987e2035eb7721e21a9d2761c3 (patch)
treef2408e7d1f7b58f49f8cefc5dda7dd56d08c98f8 /indra/llui/llurlentry.cpp
parent6f4d7c2d6d363aee60d2f3d1fe4ed4a251aaa11b (diff)
parentf378d2f95ad751ccf7456f79baba61d6c39f5c36 (diff)
Merge branch 'develop' into rlva/base
Diffstat (limited to 'indra/llui/llurlentry.cpp')
-rw-r--r--indra/llui/llurlentry.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 79d2fcd049..3cc0c05ffa 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -600,15 +600,15 @@ void LLUrlEntryAgent::callObservers(const std::string &id,
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name)
{
- avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
- if (it != mAvatarNameCacheConnections.end())
+ auto range = mAvatarNameCacheConnections.equal_range(id);
+ for (avatar_name_cache_connection_map_t::iterator it = range.first; it != range.second; ++it)
{
if (it->second.connected())
{
it->second.disconnect();
}
- mAvatarNameCacheConnections.erase(it);
}
+ mAvatarNameCacheConnections.erase(range.first, range.second);
std::string label = av_name.getCompleteName();
@@ -695,16 +695,7 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
}
else
{
- avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
- if (it != mAvatarNameCacheConnections.end())
- {
- if (it->second.connected())
- {
- it->second.disconnect();
- }
- mAvatarNameCacheConnections.erase(it);
- }
- mAvatarNameCacheConnections[agent_id] = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
+ mAvatarNameCacheConnections.emplace(agent_id, LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2)));
addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData");
@@ -770,17 +761,17 @@ LLUrlEntryAgentName::LLUrlEntryAgentName()
{}
void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id,
- const LLAvatarName& av_name)
+ const LLAvatarName& av_name)
{
- avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
- if (it != mAvatarNameCacheConnections.end())
+ auto range = mAvatarNameCacheConnections.equal_range(id);
+ for (avatar_name_cache_connection_map_t::iterator it = range.first; it != range.second; ++it)
{
if (it->second.connected())
{
it->second.disconnect();
}
- mAvatarNameCacheConnections.erase(it);
}
+ mAvatarNameCacheConnections.erase(range.first, range.second);
std::string label = getName(av_name);
// received the agent name from the server - tell our observers
@@ -815,16 +806,7 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab
}
else
{
- avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
- if (it != mAvatarNameCacheConnections.end())
- {
- if (it->second.connected())
- {
- it->second.disconnect();
- }
- mAvatarNameCacheConnections.erase(it);
- }
- mAvatarNameCacheConnections[agent_id] = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
+ mAvatarNameCacheConnections.emplace(agent_id, LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2)));
addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData");