From 10a324a1034c177b95545ac7ffaa6aa6abed65ff Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Fri, 25 Apr 2025 19:52:38 +0200 Subject: Reduce cost of joint lookups by reducing string allocations via use of std::string_view and heterogeneous map lookups (#3970) --- indra/llcharacter/lljoint.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/llcharacter/lljoint.cpp') 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; } -- cgit v1.2.3