MCPcopy Create free account
hub / github.com/Tencent/UnLua / TArray_Add

Function TArray_Add

Plugins/UnLua/Source/UnLua/Private/BaseLib/LuaLib_Array.cpp:115–130  ·  view source on GitHub ↗

* @see FLuaArray::Add(...) */

Source from the content-addressed store, hash-verified

113 * @see FLuaArray::Add(...)
114 */
115static int32 TArray_Add(lua_State* L)
116{
117 int32 NumParams = lua_gettop(L);
118 if (NumParams != 2)
119 return luaL_error(L, "invalid parameters");
120
121 FLuaArray* Array = (FLuaArray*)(GetCppInstanceFast(L, 1));
122 TArray_Guard(L, Array);
123
124 int32 Index = Array->AddDefaulted();
125 uint8* Data = Array->GetData(Index);
126 Array->Inner->Write(L, Data, 2);
127 ++Index;
128 lua_pushinteger(L, Index);
129 return 1;
130}
131
132/**
133 * @see FLuaArray::AddUnique(...)

Callers

nothing calls this directly

Calls 8

lua_gettopFunction · 0.85
luaL_errorFunction · 0.85
GetCppInstanceFastFunction · 0.85
TArray_GuardFunction · 0.85
lua_pushintegerFunction · 0.85
AddDefaultedMethod · 0.80
GetDataMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected