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

Function TArray_Find

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

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

Source from the content-addressed store, hash-verified

154 * @see FLuaArray::Find(...)
155 */
156static int32 TArray_Find(lua_State* L)
157{
158 int32 NumParams = lua_gettop(L);
159 if (NumParams != 2)
160 return luaL_error(L, "invalid parameters");
161
162 FLuaArray* Array = (FLuaArray*)(GetCppInstanceFast(L, 1));
163 TArray_Guard(L, Array);
164
165 Array->Inner->Initialize(Array->ElementCache);
166 Array->Inner->Write(L, Array->ElementCache, 2);
167 int32 Index = Array->Find(Array->ElementCache);
168 Array->Inner->Destruct(Array->ElementCache);
169 ++Index;
170 lua_pushinteger(L, Index);
171 return 1;
172}
173
174/**
175 * @see FLuaArray::Insert(...)

Callers

nothing calls this directly

Calls 9

lua_gettopFunction · 0.85
luaL_errorFunction · 0.85
GetCppInstanceFastFunction · 0.85
TArray_GuardFunction · 0.85
lua_pushintegerFunction · 0.85
InitializeMethod · 0.45
WriteMethod · 0.45
FindMethod · 0.45
DestructMethod · 0.45

Tested by

no test coverage detected