summaryrefslogtreecommitdiff
path: root/indra/llcharacter/lljoint.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/llcharacter/lljoint.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/llcharacter/lljoint.cpp')
-rw-r--r--indra/llcharacter/lljoint.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index f31aa5d4c9..405e62a38b 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -242,21 +242,20 @@ LLJoint *LLJoint::getRoot()
//-----------------------------------------------------------------------------
// findJoint()
//-----------------------------------------------------------------------------
-LLJoint *LLJoint::findJoint( const std::string &name )
+LLJoint* LLJoint::findJoint(std::string_view name)
{
if (name == getName())
return this;
for (LLJoint* joint : mChildren)
{
- LLJoint *found = joint->findJoint(name);
- if (found)
+ if (LLJoint* found = joint->findJoint(name))
{
return found;
}
}
- return NULL;
+ return nullptr;
}