* @see FLuaArray::Reserve(...) */
| 250 | * @see FLuaArray::Reserve(...) |
| 251 | */ |
| 252 | static int32 TArray_Reserve(lua_State* L) |
| 253 | { |
| 254 | int32 NumParams = lua_gettop(L); |
| 255 | if (NumParams != 2) |
| 256 | return luaL_error(L, "invalid parameters"); |
| 257 | |
| 258 | FLuaArray* Array = (FLuaArray*)(GetCppInstanceFast(L, 1)); |
| 259 | TArray_Guard(L, Array); |
| 260 | |
| 261 | int32 Size = lua_tointeger(L, 2); |
| 262 | bool bSuccess = Array->Reserve(Size); |
| 263 | if (!bSuccess) |
| 264 | { |
| 265 | UE_LOG(LogUnLua, Warning, TEXT("%s: 'Reserve' is only valid for empty TArray!"), ANSI_TO_TCHAR(__FUNCTION__)); |
| 266 | } |
| 267 | lua_pushboolean(L, bSuccess); |
| 268 | return 1; |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * @see FLuaArray::Resize(...) |
nothing calls this directly
no test coverage detected