diff options
author | ShadowNinja <shadowninja@minetest.net> | 2013-11-30 12:11:07 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2013-11-30 13:05:13 -0500 |
commit | 4594ba652293e776ccba2184c16502a346f4147a (patch) | |
tree | 19713fac8de559ba86cd9d08d9c07cb1c7241e37 /src/script/lua_api/l_rollback.cpp | |
parent | 06baf05c641355ead97e9428c4455af9e8b11cef (diff) | |
download | hax-minetest-server-4594ba652293e776ccba2184c16502a346f4147a.tar.gz hax-minetest-server-4594ba652293e776ccba2184c16502a346f4147a.zip |
Optimize table creation
Diffstat (limited to '')
-rw-r--r-- | src/script/lua_api/l_rollback.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/script/lua_api/l_rollback.cpp b/src/script/lua_api/l_rollback.cpp index e7185b00b..b3685c8d1 100644 --- a/src/script/lua_api/l_rollback.cpp +++ b/src/script/lua_api/l_rollback.cpp @@ -50,7 +50,6 @@ int ModApiRollback::l_rollback_get_node_actions(lua_State *L) lua_createtable(L, actions.size(), 0); for (unsigned int i = 1; iter != actions.end(); ++iter, ++i) { - lua_pushnumber(L, i); // Push index lua_createtable(L, 0, 5); // Make a table with enough space pre-allocated lua_pushstring(L, iter->actor.c_str()); @@ -68,7 +67,7 @@ int ModApiRollback::l_rollback_get_node_actions(lua_State *L) push_RollbackNode(L, iter->n_new); lua_setfield(L, -2, "newnode"); - lua_settable(L, -3); // Add action table to main table + lua_rawseti(L, -2, i); // Add action table to main table } return 1; |