We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d947087 commit 7d45104Copy full SHA for 7d45104
source/lua_utils.cpp
@@ -7,9 +7,10 @@ namespace AsyncIO::LuaUtils {
7
do {
8
firstPos = endPos;
9
endPos = path.find(".", endPos) + 1;
10
- std::string name{ path.substr(firstPos, endPos != 0 ? endPos - firstPos - 1 : path.size()) };
+ std::string_view name = path.substr(firstPos, endPos != 0 ? endPos - firstPos - 1 : path.size());
11
+ std::string name_copy {name.data(), name.size()};
12
- LUA->GetField(firstPos == 0 ? GarrysMod::Lua::INDEX_GLOBAL : -1, name.c_str());
13
+ LUA->GetField(firstPos == 0 ? GarrysMod::Lua::INDEX_GLOBAL : -1, name_copy.c_str());
14
if (firstPos != 0) LUA->Remove(-2);
15
if (!LUA->IsType(-1, GarrysMod::Lua::Type::Table)) break;
16
} while (endPos != 0);
0 commit comments