Skip to content

Commit

Permalink
Remove ready_for_table_mt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan authored and well-in-that-case committed Nov 14, 2023
1 parent 7ee6784 commit cfb1b85
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/lbaselib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,6 @@ LUAMOD_API int luaopen_base (lua_State *L) {
lua_pushboolean(L, false);
#endif
lua_setfield(L, -2, "_PSOUP");
#ifndef PLUTO_NO_DEFAULT_TABLE_METATABLE
G(L)->ready_for_table_mt = false;
#endif
#ifndef PLUTO_NO_DEFAULT_TABLE_METATABLE
G(L)->ready_for_table_mt = true;
#endif
return 1;
}

1 change: 0 additions & 1 deletion src/lstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ static void f_luaopen (lua_State *L, void *ud) {
g->gcstp = 0; /* allow gc */
setnilvalue(&g->nilvalue); /* now state is complete */
#ifndef PLUTO_NO_DEFAULT_TABLE_METATABLE
g->ready_for_table_mt = true;
setnilvalue(&g->table_mt);
#endif
luai_userstateopen(L);
Expand Down
1 change: 0 additions & 1 deletion src/lstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ typedef struct global_State {
std::time_t deadline;
#endif
#ifndef PLUTO_NO_DEFAULT_TABLE_METATABLE
bool ready_for_table_mt;
TValue table_mt;
#endif
} global_State;
Expand Down
2 changes: 0 additions & 2 deletions src/ltable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,6 @@ Table *luaH_new (lua_State *L) {

#ifndef PLUTO_NO_DEFAULT_TABLE_METATABLE
void luaH_initmetatable (lua_State *L, Table *t) {
if (!G(L)->ready_for_table_mt)
return;
L->ci->top.p++;
lua_pushnil(L); /* space on the stack where the metatable will go */
if (ttisnil(&G(L)->table_mt)) {
Expand Down

0 comments on commit cfb1b85

Please sign in to comment.