summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorAnsariel Hiller <Ansariel@users.noreply.github.com>2025-04-25 19:52:38 +0200
committerGitHub <noreply@github.com>2025-04-25 20:52:38 +0300
commit10a324a1034c177b95545ac7ffaa6aa6abed65ff (patch)
treebfa78ec1ac88c92199339ed8b24ee3b5f50ecb4b /indra/newview/llvoavatar.cpp
parent3e5f4fd0c4cb31d94c9255b46d3ff9e2f06d327b (diff)
Reduce cost of joint lookups by reducing string allocations via use of std::string_view and heterogeneous map lookups (#3970)
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 40312b7f4e..c5ca8030fe 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6306,13 +6306,13 @@ const LLUUID& LLVOAvatar::getID() const
// getJoint()
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
-LLJoint *LLVOAvatar::getJoint( const std::string &name )
+LLJoint* LLVOAvatar::getJoint(std::string_view name)
{
joint_map_t::iterator iter = mJointMap.find(name);
- LLJoint* jointp = NULL;
+ LLJoint* jointp = nullptr;
- if (iter == mJointMap.end() || iter->second == NULL)
+ if (iter == mJointMap.end() || iter->second == nullptr)
{ //search for joint and cache found joint in lookup table
if (mJointAliasMap.empty())
{
@@ -6329,7 +6329,7 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name )
canonical_name = name;
}
jointp = mRoot->findJoint(canonical_name);
- mJointMap[name] = jointp;
+ mJointMap[std::string(name)] = jointp;
}
else
{ //return cached pointer