diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-06-12 16:49:19 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-06-12 16:49:19 -0400 |
commit | 52ff9dfe404e4a49ac43185004218ce4e50e2971 (patch) | |
tree | afe13d8d9626d1616900e07703bd6734e7971c85 | |
parent | 241156cf9831e30a3bbb529478e73aaf233a759b (diff) |
For a single string concatenation, use operator+().
stringize() constructs, populates and destroys a std::ostringstream, which is
actually less efficient than directly allocating a std::string big enough for
the result of operator+().
Maybe someday we'll specialize stringize(p0, p1) for the case in which they're
both string-like, and invoke operator+() for that situation...
-rw-r--r-- | indra/newview/llluamanager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp index 97779a12ad..6f72eb4142 100644 --- a/indra/newview/llluamanager.cpp +++ b/indra/newview/llluamanager.cpp @@ -254,7 +254,7 @@ void LLLUAmanager::runScriptLine(LuaState& L, const std::string& chunk, script_r if (shortchunk.length() > shortlen) shortchunk = stringize(shortchunk.substr(0, shortlen), "..."); - std::string desc{ stringize("lua: ", shortchunk) }; + std::string desc{ "lua: " + shortchunk }; LLCoros::instance().launch(desc, [&L, desc, chunk, cb]() { auto [count, result] = L.expr(desc, chunk); |