Skip to content

Commit c7afea4

Browse files
committed
Added missing string headers
1 parent 7d45104 commit c7afea4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/lua_utils.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "lua_utils.hpp"
2+
#include <string>
3+
#include <string_view>
24

35
namespace AsyncIO::LuaUtils {
46
void FindValue(GarrysMod::Lua::ILuaBase* LUA, std::string_view path) {
@@ -7,10 +9,9 @@ namespace AsyncIO::LuaUtils {
79
do {
810
firstPos = endPos;
911
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()) };
1213

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());
1415
if (firstPos != 0) LUA->Remove(-2);
1516
if (!LUA->IsType(-1, GarrysMod::Lua::Type::Table)) break;
1617
} while (endPos != 0);

0 commit comments

Comments
 (0)