summaryrefslogtreecommitdiff
path: root/indra/llappearance/llwearable.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-03-26 21:05:36 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-03-27 18:29:19 +0200
commitd67859e48351a4db498f658030c0eb2866d59e77 (patch)
tree56f506d6c17a138a76747ce938d04ce7e986153f /indra/llappearance/llwearable.cpp
parent7d5a5e939a7427fb0cabc99e10f75d7d99c5f133 (diff)
Use LLCachedControl in llviewerwindow and llappviewer
Getting from gSavedSettings is expensive to do so often
Diffstat (limited to 'indra/llappearance/llwearable.cpp')
-rw-r--r--indra/llappearance/llwearable.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index f30c147b91..4acb0ef3d4 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -645,9 +645,10 @@ void LLWearable::addVisualParam(LLVisualParam *param)
void LLWearable::setVisualParamWeight(S32 param_index, F32 value)
{
- if( is_in_map(mVisualParamIndexMap, param_index ) )
+ visual_param_index_map_t::iterator found = mVisualParamIndexMap.find(param_index);
+ if(found != mVisualParamIndexMap.end())
{
- LLVisualParam *wearable_param = mVisualParamIndexMap[param_index];
+ LLVisualParam *wearable_param = found->second;
wearable_param->setWeight(value);
}
else
@@ -658,10 +659,10 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value)
F32 LLWearable::getVisualParamWeight(S32 param_index) const
{
- if( is_in_map(mVisualParamIndexMap, param_index ) )
+ visual_param_index_map_t::const_iterator found = mVisualParamIndexMap.find(param_index);
+ if(found != mVisualParamIndexMap.end())
{
- const LLVisualParam *wearable_param = mVisualParamIndexMap.find(param_index)->second;
- return wearable_param->getWeight();
+ return found->second->getWeight();
}
else
{
@@ -726,7 +727,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
if (!avatarp) return;
// Pull params
- for( LLVisualParam* param = avatarp->getFirstVisualParam(); param; param = avatarp->getNextVisualParam() )
+ for( const LLVisualParam* param = avatarp->getFirstVisualParam(); param; param = avatarp->getNextVisualParam() )
{
// cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the
// avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way.