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() ...@@ -991,14 +991,12 @@ void LLPolyMesh::initializeForMorph()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// getMorphData() // getMorphData()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) LLPolyMorphData* LLPolyMesh::getMorphData(const std::string_view morph_name)
{ {
if (!mSharedData) if (!mSharedData)
return NULL; return NULL;
for (LLPolyMeshSharedData::morphdata_list_t::iterator iter = mSharedData->mMorphData.begin(); for (LLPolyMorphData* morph_data : mSharedData->mMorphData)
iter != mSharedData->mMorphData.end(); ++iter)
{ {
LLPolyMorphData *morph_data = *iter;
if (morph_data->getName() == morph_name) if (morph_data->getName() == morph_name)
{ {
return morph_data; return morph_data;
......
...@@ -306,7 +306,7 @@ class LLPolyMesh ...@@ -306,7 +306,7 @@ class LLPolyMesh
return mSharedData->mJointNames; return mSharedData->mJointNames;
} }
LLPolyMorphData* getMorphData(const std::string& morph_name); LLPolyMorphData* getMorphData(std::string_view morph_name);
// void removeMorphData(LLPolyMorphData *morph_target); // void removeMorphData(LLPolyMorphData *morph_target);
// void deleteAllMorphData(); // void deleteAllMorphData();
......
...@@ -378,7 +378,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) ...@@ -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); mMorphData = mMesh->getMorphData(morph_param_name);
if (!mMorphData) 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