diff options
Diffstat (limited to 'src/tre/ltre_w.c')
-rw-r--r-- | src/tre/ltre_w.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/tre/ltre_w.c b/src/tre/ltre_w.c index ade0ab8..4744cb1 100644 --- a/src/tre/ltre_w.c +++ b/src/tre/ltre_w.c @@ -216,26 +216,18 @@ static const luaL_Reg r_functions[] = { }; /* Add the library */ -void add_wide_lib (lua_State *L, int methods) +void add_wide_lib (lua_State *L) { (void)alg_register; + lua_pushvalue(L, -2); #if LUA_VERSION_NUM == 501 - if (methods) { - lua_pushvalue(L, -2); - luaL_register(L, NULL, r_methods); - lua_pop(L, 1); - } - else - luaL_register(L, NULL, r_functions); + luaL_register(L, NULL, r_methods); + lua_pop(L, 1); + luaL_register(L, NULL, r_functions); #else - lua_pushvalue(L, -2); - if (methods) { - lua_pushvalue(L, -1); - luaL_setfuncs(L, r_methods, 1); - lua_pop(L, 1); - } - else - luaL_setfuncs(L, r_functions, 1); + lua_pushvalue(L, -1); + luaL_setfuncs(L, r_methods, 1); + luaL_setfuncs(L, r_functions, 1); #endif } |