1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

scriptapi: Some small optimizations to value pushing (#9669)

This commit is contained in:
sfan5 2020-04-14 20:44:18 +02:00 committed by GitHub
parent 7c43cf47c3
commit 2d5bd3bf79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 67 deletions

View file

@ -72,7 +72,7 @@ int LuaVoxelManip::l_get_data(lua_State *L)
if (use_buffer)
lua_pushvalue(L, 2);
else
lua_newtable(L);
lua_createtable(L, volume, 0);
for (u32 i = 0; i != volume; i++) {
lua_Integer cid = vm->m_data[i].getContent();
@ -261,7 +261,7 @@ int LuaVoxelManip::l_get_light_data(lua_State *L)
u32 volume = vm->m_area.getVolume();
lua_newtable(L);
lua_createtable(L, volume, 0);
for (u32 i = 0; i != volume; i++) {
lua_Integer light = vm->m_data[i].param1;
lua_pushinteger(L, light);
@ -309,7 +309,7 @@ int LuaVoxelManip::l_get_param2_data(lua_State *L)
if (use_buffer)
lua_pushvalue(L, 2);
else
lua_newtable(L);
lua_createtable(L, volume, 0);
for (u32 i = 0; i != volume; i++) {
lua_Integer param2 = vm->m_data[i].param2;