summaryrefslogtreecommitdiff
path: root/indra/llmessage/llavatarnamecache.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-05-04 09:38:29 -0400
committerOz Linden <oz@lindenlab.com>2011-05-04 09:38:29 -0400
commit383fccbd57ef273aa803497ad87cf9badc5db90a (patch)
treeab042292d129a92092b35accde69eb57a3565389 /indra/llmessage/llavatarnamecache.cpp
parentf5bb046c5d3d393352b5b90424837a3d213dfbb9 (diff)
parentb9bb792c478d703c6442351ecb563c0a67f77111 (diff)
merge changes for viewer-development before mesh merge
Diffstat (limited to 'indra/llmessage/llavatarnamecache.cpp')
-rw-r--r--indra/llmessage/llavatarnamecache.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 767001b633..97f2792686 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -553,12 +553,10 @@ 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 = it->first;
@@ -566,8 +564,12 @@ void LLAvatarNameCache::eraseUnrefreshed()
<< " 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;
}