summaryrefslogtreecommitdiff
path: root/indra/llmessage/llavatarnamecache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llavatarnamecache.cpp')
-rw-r--r--indra/llmessage/llavatarnamecache.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index f6a1aca71b..97f2792686 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -553,21 +553,23 @@ void LLAvatarNameCache::eraseUnrefreshed()
if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed)
{
sLastExpireCheck = now;
- cache_t::iterator it = sCache.begin();
- while (it != sCache.end())
+
+ for (cache_t::iterator it = sCache.begin(); it != sCache.end();)
{
- cache_t::iterator cur = it;
- ++it;
- const LLAvatarName& av_name = cur->second;
+ const LLAvatarName& av_name = it->second;
if (av_name.mExpires < max_unrefreshed)
{
- const LLUUID& agent_id = cur->first;
+ const LLUUID& agent_id = it->first;
LL_DEBUGS("AvNameCache") << agent_id
<< " user '" << av_name.mUsername << "' "
<< "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL;
- sCache.erase(cur);
+ sCache.erase(it++);
}
+ else
+ {
+ ++it;
+ }
}
LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL;
}