File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
#include " lua_utils.hpp"
2
+ #include < string>
3
+ #include < string_view>
2
4
3
5
namespace AsyncIO ::LuaUtils {
4
6
void FindValue (GarrysMod::Lua::ILuaBase* LUA, std::string_view path) {
@@ -7,10 +9,9 @@ namespace AsyncIO::LuaUtils {
7
9
do {
8
10
firstPos = endPos;
9
11
endPos = path.find (" ." , endPos) + 1 ;
10
- std::string_view name = path.substr (firstPos, endPos != 0 ? endPos - firstPos - 1 : path.size ());
11
- std::string name_copy {name.data (), name.size ()};
12
+ std::string name{ path.substr (firstPos, endPos != 0 ? endPos - firstPos - 1 : path.size ()) };
12
13
13
- LUA->GetField (firstPos == 0 ? GarrysMod::Lua::INDEX_GLOBAL : -1 , name_copy .c_str ());
14
+ LUA->GetField (firstPos == 0 ? GarrysMod::Lua::INDEX_GLOBAL : -1 , name .c_str ());
14
15
if (firstPos != 0 ) LUA->Remove (-2 );
15
16
if (!LUA->IsType (-1 , GarrysMod::Lua::Type::Table)) break ;
16
17
} while (endPos != 0 );
You can’t perform that action at this time.
0 commit comments