summaryrefslogtreecommitdiff
path: root/indra/llcommon/lua_function.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-10 15:25:07 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-10 15:25:07 -0400
commit26efc7e376ef52284a6281f36cf45eb03bc13507 (patch)
tree389564bf0eeac27274cad06aadd2342d1768126f /indra/llcommon/lua_function.cpp
parentb8678d8fa3521f4496ddc569de391633711e46cb (diff)
Pass std::string_view by value, not by const reference.
Consensus seems to be that (a) string_view is, in effect, already a reference, (b) it's small enough to make pass-by-value reasonable and (c) the optimizer can reason about values way better than it can about references.
Diffstat (limited to 'indra/llcommon/lua_function.cpp')
-rw-r--r--indra/llcommon/lua_function.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/indra/llcommon/lua_function.cpp b/indra/llcommon/lua_function.cpp
index eefb1e62cf..380e650360 100644
--- a/indra/llcommon/lua_function.cpp
+++ b/indra/llcommon/lua_function.cpp
@@ -999,8 +999,8 @@ LuaPopper::~LuaPopper()
/*****************************************************************************
* LuaFunction class
*****************************************************************************/
-LuaFunction::LuaFunction(const std::string_view& name, lua_CFunction function,
- const std::string_view& helptext)
+LuaFunction::LuaFunction(std::string_view name, lua_CFunction function,
+ std::string_view helptext)
{
const auto& [registry, lookup] = getState();
registry.emplace(name, Registry::mapped_type{ function, helptext });