Skip to content

Commit

Permalink
print: Move state_view out of loop
Browse files Browse the repository at this point in the history
It doesn't need to be created each time

Signed-off-by: Jarosław Pelczar <[email protected]>
  • Loading branch information
jarekpelczar committed Jun 29, 2024
1 parent 8b0f9b6 commit 2cf022d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion luacapturescript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ void LuaCaptureScript::registerSol(sol::state &lua) {
lua.set_function("print", [&](const sol::variadic_args& va) {
QString result;
int n = 0;
sol::state_view ref(va.lua_state());
for(auto a : va) {
++n;
sol::state_view ref(a.lua_state());
if (n > 1)
result.append("\t");
result += ref["tostring"](a).get<std::string>();
Expand Down

0 comments on commit 2cf022d

Please sign in to comment.