Skip to content
Snippets Groups Projects
Commit f4d54add authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Reduce string operations in polymorph targets

parent 2da54573
No related branches found
No related tags found
No related merge requests found
......@@ -991,14 +991,12 @@ void LLPolyMesh::initializeForMorph()
//-----------------------------------------------------------------------------
// getMorphData()
//-----------------------------------------------------------------------------
LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name)
LLPolyMorphData* LLPolyMesh::getMorphData(const std::string_view morph_name)
{
if (!mSharedData)
return NULL;
for (LLPolyMeshSharedData::morphdata_list_t::iterator iter = mSharedData->mMorphData.begin();
iter != mSharedData->mMorphData.end(); ++iter)
for (LLPolyMorphData* morph_data : mSharedData->mMorphData)
{
LLPolyMorphData *morph_data = *iter;
if (morph_data->getName() == morph_name)
{
return morph_data;
......
......@@ -306,7 +306,7 @@ class LLPolyMesh
return mSharedData->mJointNames;
}
LLPolyMorphData* getMorphData(const std::string& morph_name);
LLPolyMorphData* getMorphData(std::string_view morph_name);
// void removeMorphData(LLPolyMorphData *morph_target);
// void deleteAllMorphData();
......
......@@ -378,7 +378,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
}
}
std::string morph_param_name = getInfo()->mMorphName;
std::string_view morph_param_name = getInfo()->mMorphName;
mMorphData = mMesh->getMorphData(morph_param_name);
if (!mMorphData)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment