Cache the lookup of the sim access level.

Being part of the state line, it is called every frame, causing a
translation lookup every frame.
This commit is contained in:
Aleric Inglewood
2013-11-05 02:19:57 +01:00
parent 66a43ea537
commit 54b43f1ad7
2 changed files with 12 additions and 4 deletions

View File

@@ -599,9 +599,15 @@ BOOL LLViewerRegion::canManageEstate() const
|| gAgent.getID() == getOwner();
}
const std::string LLViewerRegion::getSimAccessString() const
std::string const& LLViewerRegion::getSimAccessString()
{
return accessToString(mSimAccess);
// Singu: added a cache because this is called every frame.
if (mLastSimAccess != mSimAccess)
{
mSimAccessString = accessToString(mSimAccess);
mLastSimAccess = mSimAccess;
}
return mSimAccessString;
}
std::string LLViewerRegion::getLocalizedSimProductName() const