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

Function TMap_Remove

Plugins/UnLua/Source/UnLua/Private/BaseLib/LuaLib_Map.cpp:151–166  ·  view source on GitHub ↗

* @see FLuaMap::Remove(...) */

Source from the content-addressed store, hash-verified

149 * @see FLuaMap::Remove(...)
150 */
151static int32 TMap_Remove(lua_State* L)
152{
153 int32 NumParams = lua_gettop(L);
154 if (NumParams != 2)
155 return luaL_error(L, "invalid parameters");
156
157 FLuaMap* Map = (FLuaMap*)(GetCppInstanceFast(L, 1));
158 TMap_Guard(L, Map);
159
160 Map->KeyInterface->Initialize(Map->ElementCache);
161 Map->KeyInterface->Write(L, Map->ElementCache, 2);
162 bool bSuccess = Map->Remove(Map->ElementCache);
163 Map->KeyInterface->Destruct(Map->ElementCache);
164 lua_pushboolean(L, bSuccess);
165 return 1;
166}
167
168/**
169 * @see FLuaMap::Find(...). Create a copy for the value

Callers

nothing calls this directly

Calls 9

lua_gettopFunction · 0.85
luaL_errorFunction · 0.85
GetCppInstanceFastFunction · 0.85
TMap_GuardFunction · 0.85
lua_pushbooleanFunction · 0.85
InitializeMethod · 0.45
WriteMethod · 0.45
RemoveMethod · 0.45
DestructMethod · 0.45

Tested by

no test coverage detected